Feature functions
You can use feature functions in sort expressions. Most of these functions are supported only in fine sort expressions. You can combine various syntax and statements to create powerful sorting features.
Create an index or property for any document field used as a feature function parameter, as specified in the function's documentation..
query_min_slide_window: The ratio of hit token groups from a search query to the minimum window size in a field
1. Usage details:
query_min_slide_window(field_name, in_order=false, index_name)
2. Parameters:
field_name: The field to analyze. The field must be one of the following types: TEXT, basic Chinese tokenization, custom tokenization, single-word tokenization, English tokenization, or fuzzy tokenization.
in_order: true|false. Optional. The default value is false. Specifies whether the order of token groups in the sliding window must match the order in the search query.
index_name: The name of the index for `field_name`. This parameter is optional.
3. Return value:
A float value in the range of [0, 1].
4. Scenarios:
Scenario 1: Calculate the minimum sliding window in the title that contains the search query query_min_slide_window(title)
Scenario 2: Check if the `title` field contains a subsequence identical to the search query. if(query_min_slide_window(title, true) > 0.99, 1, 0)
5. Notes:
Create an index of the appropriate type for the field that is used as a parameter for the function.
This function can be used in fine sort expressions.
Measures the textual proximity of search query terms within the `field_name` field.
Two factors affect the sliding window calculation: the number of query terms that are hit in the `field_name` field, and the size of the minimum window that contains these terms.