All Products
Search
Document Center

OpenSearch:com.aliyun.opensearch.cava

Last Updated:Feb 06, 2023

Common feature classes

Overview

The com.aliyun.opensearch.cava.features package encapsulates the feature libraries and feature functions that are used for the score calculation of a sort plug-in. You can use these feature libraries to perform various operations. For example, you can calculate the relevance of a query term to a category in a document, match query requests with document tags and allocate weights to the tags, or calculate the popularity scores of documents.

Classes

Function classes

Class

Description

TagMatch

Matches search queries in requests with tags in documents.

Util

Provides a set of common functionality functions such as decay functions and normalization functions.

first_phase_score

Returns the score that is calculated by using a basic expression.

Algorithm classes

Class

Description

CategoryScore

Obtains the score that indicates the relevance of a query term to a category in a document.

Popularity

Obtains the popularity score of a document.

Time-related classes

Class

Description

Time

Provides a set of time-related functions that are used to obtain the current time or the timeliness score of a document.

Geographic location classes

Class

Description

Distance

Calculates the spherical distance between a point in a document and a point in a request.

Relevance-related feature classes

Overview

The com.aliyun.opensearch.cava.features.similarity package encapsulates the feature classes that are used to calculate text relevance during the score calculation and sorting of a sort plug-in. You can use these feature classes to calculate the text relevance of a query term to a document. In addition to the common feature classes that are related to text relevance, OpenSearch provides the following child packages of the com.aliyun.opensearch.cava.features.similarity package to allow you to perform more operations:

  • com.aliyun.opensearch.cava.features.similarity.distribution: calculates the distribution of a query term in a field.

  • com.aliyun.opensearch.cava.features.similarity.fieldmatch: calculates the proximity of a query term to a field.

  • com.aliyun.opensearch.cava.features.similarity.querymatch: calculates the proximity of a field in a document to an entire query.

Common relevance-related classes

Class

Description

TextRelevance

Calculates the text relevance between a query term and a specified field.

ProximaScore

Calculates the relevance of vector indexs in the query.

basicSimilarityScore

Calculates a BasicSimilarityScore score, which is mainly used for the IntelligenceAlgorithmScorer class.

Classes in the com.aliyun.opensearch.cava.features.similarity.distribution package

Class

Description

FieldTermProximity

Calculates the proximity of a query term to a specified field.

QueryMinSlideWindow

Calculates the ratio of the number of terms that a search query hits in a specific field to the minimum window of the search query in the field.

Classes in the com.aliyun.opensearch.cava.features.similarity.fieldmatch package

Class

Description

FieldLength

Obtains the number of terms after the analysis of a field in an index.

FieldMatchRatio

Calculates the ratio of terms that a search query hits in a specified field to all terms in the field.

FieldTermMatchCount

Calculates the number of terms that a search query hits in an index.

FieldMatchWeighted

Calculates the proximity of a query term to a specific field.

BM25

Calculates the BM25 score of a query term based on a specific field.

BM25F

Calculates the text relevance of a query term to multiple specified fields based on the BM25 class.

KeyWordsMatched

Measures the extent to which the keywords of a search query match a specific field.

Classes in the com.aliyun.opensearch.cava.features.similarity.querymatch package

Class

Description

QueryMatchRatio

Calculates the ratio of terms that a search query hits in a specific field or all fields of an index to all terms in the index.

QueryTermCount

Calculates the number of query terms after analysis.

QueryTermMatchCount

Calculates the number of terms that a search query hits in an index.

Algorithm model feature classes

The com.aliyun.opensearch.cava.features.algo package encapsulates the feature class that is used to calculate scores based on a deep learning model. You can use the feature class to calculate the score of document based on a deep learning model.

Class in the com.aliyun.opensearch.cava.features.algo package

Class

Description

AlgoModel

Calculates the score of a document based on a deep learning model. Make sure that you have configured a deep learning model in OpenSearch and the test data of the model has flowed back. The feature class can be used only for the IntelligenceAlgorithmScorer class.