All Products
Document Center


Last Updated:Sep 09, 2021

Feature functions

You can use feature functions in sort expressions. Most feature functions can be used only in fine sort expressions. You can combine various syntax and clauses to perform complex sorts.

The fields that you reference in parameters of feature functions must be configured as index or attribute fields based on the description of each function.

exact_match_boost: returns the maximum weight of the search query entered by a user





3.Return value:

The return value is of the INT type. Valid values: 0 to 99.


Scenario 1:

The query clause is query=default:'OpenSearch'^60 OR default:'opensearch'^50. You want to sort documents based on the boost weight of a matching term. For example, Document A contains the term OpenSearch, and Document B contains the term opensearch. In this case, Document A ranks higher than Document B.

The rough sort expression is exact_match_boost(). // No fine sort expression is configured. By default, documents are sorted based on the score that is calculated by using the rough sort expression.

5.Usage notes:

  • The field that you reference in the parameter of the function must be configured as an attribute field.

  • If no boost weight is specified for a search query, the default boost weight is 99.

  • If the exact_match_boost function is used in a rough sort expression for an exclusive application, the supported function parameters include '', 'sum', and 'max'.