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.
field_match_ratio: returns the ratio of the number of terms that match the search query to the total number of terms in a field
field_name: the name of the field for which you want to collect statistics. The field must be of the TEXT or SHORT_TEXT type. The analyzer can be the general analyzer for Chinese, a custom analyzer, the single character analyzer for Chinese, an analyzer for English, or the fuzzy analyzer.
The return value is of the FLOAT type. Valid values: [0,1].
Use a fine sort expression to calculate the proximity of the title and body fields in a query.
field_match_ratio(title)*10 + field_match_ratio(body)
The field that you reference in the parameter of this feature function must be configured as an index field.
You can use this feature function in fine sort expressions.
This feature function can be used to calculate the proximity of the title and body fields in the query.