Feature function
You can use a feature function in a ranking expression to build powerful sorting logic. Most feature functions are only supported in fine-ranking expressions.
The document fields used as parameters in a feature function must be created as indexes or attributes as specified in the function's documentation.
exact_match_boost: Maximum query word weight
1. Syntax
exact_match_boost()
2. Parameters
None
3. Return value
int. The value ranges from 0 to 99.
4. Scenarios
Scenario 1:
Consider the query query=default:'Open Search'^60 OR default:'opensearch'^50. If results are sorted by the matched term's boost weight, Document A (containing "Open Search") is ranked higher than Document B (containing "opensearch").
Set the coarse-ranking expression to exact_match_boost() and leave the fine-ranking expression empty. By default, if you do not specify a fine-ranking expression, results are sorted based on the score calculated from the coarse-ranking expression.
5. Usage notes
-
The document fields referenced by the function parameters must be created as an index.
-
If a query word does not have an explicit boost weight, the default boost weight is 99.
-
For dedicated applications, the
exact_match_boostfunction can be configured in Basic Ranking and supports the'',sum, andmaxparameters. In Scoring Feature Configuration, exact_match_boost() supports three aggregation methods: '' (default), max, and sum. You can select an aggregation method and set a weight based on your business requirements.