popularity

更新时间:
复制 MD 格式

Feature function

Feature functions can be used in sort expressions. Most are supported only in fine sort expressions. You can combine various syntax and statements to create powerful sorting features. Document fields used as parameters for a feature function must be created as an index or a property. For instructions, see the documentation for the function.

popularity: A popularity score that measures how popular an item is.

1. Usage details:

popularity(model_name)

2. Parameters:

model_name: The name of the popularity model. You must create the popularity model in OpenSearch. For more information, see Popularity model.

3. Return value:

float. The value is in the range [0,1]. A larger value indicates that the item is more popular.

4. Scenario:

Scenario 1: Train a Popularity model. Then, combine the model with other features in a fine sort expression to calculate a score: text_relevance(title)*3+popularity(model_name)

5. Note:

Use this function with the Popularity model feature.