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 |
|---|---|
Matches search queries in requests with tags in documents. | |
Provides a set of common functionality functions, such as decay functions and normalization functions. | |
Obtains the score that is calculated by using a rough sort expression. |
Algorithm classes
Class | Description |
|---|---|
Obtains the score that indicates the relevance of a query term to a category in a document. | |
Obtains the popularity score of a document. |
Time-related classes
Class | Description |
|---|---|
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 |
|---|---|
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 |
|---|---|
Calculates the text relevance between a query term and a specific field. | |
Calculates the proximity of documents to a vector index in a search. | |
Obtains the scores calculated by using the BasicSimilarityScorer class. The calculated scores can be used in the IntelligenceAlgorithmScorer class. |
Class | Description |
|---|---|
Calculates the proximity of a query term to a specific field. | |
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. |
Class | Description |
|---|---|
Obtains the number of terms after the analysis of a field in an index. | |
Calculates the ratio of terms that a search query hits in a specific field to all terms in the field. | |
Calculates the number of terms that a search query hits in an index. | |
Calculates the proximity of a query term to a specific field. | |
Calculates the BM25 score of a query term based on a specific field. | |
Calculates the text relevance of a query term to multiple specific fields based on the BM25 class. | |
Measures the extent to which the keywords of a search query match a specific field. |
Class | Description |
|---|---|
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. | |
Calculates the number of query terms after analysis. | |
Calculates the number of terms that a search query hits in an index. |
Algorithm model-related feature classes
The com.aliyun.opensearch.cava.features.algo package encapsulates an algorithm model-related feature class that is used for the score calculation. You can use the feature class to calculate the scores of the algorithm models that are used during the score calculation.
Class
Class | Description |
|---|---|
AlgoModel | Supports deep learning models for scoring documents. To use this class, make sure that a deep learning model is configured in OpenSearch and the model is available. This class can be used only in the IntelligenceAlgorithmScorer class. |