All Products
Search
Document Center

:exact_match_boost

Last Updated:Mar 02, 2023

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 statements to perform complex sorts.

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

exact_match_boost: Returns the maximum boost weight of search queries in a query string

1. Syntax

exact_match_boost()

2. Parameters

None

3. Return value

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

4. Scenarios

Scenario 1

The query clause is query=default:'OpenSearch'^60 OR default:'opensearch'^50. You want to sort documents based on the boost weight that is specified in the query clause for 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 parameters of this function must be configured as an index 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'.image