All Products
Search
Document Center

com.aliyun.opensearch.cava

Last Updated: Sep 09, 2021

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.

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.

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 specified 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 specified field.

BM25

Calculates the BM25 score of a query term based on a specified 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 specified 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 specified 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.