timeliness_ms

更新时间:
复制 MD 格式

Feature functions

Feature functions are used in sort expressions. You can combine various syntax and statements with these functions to create powerful sorting features. Most feature functions support only fine sort expressions.

You must configure the document fields that are used as parameters in a feature function as an index or a property, as specified in the documentation for that function.

timeliness_ms: Measures document recency

1. Usage details:

timeliness_ms(pubtime)

2. Parameters:

pubtime: The field to evaluate. The data type of this field must be int32 or int64, and its value must be in milliseconds.

3. Return value:

Returns a float value in the range of [0, 1]. A larger value indicates a more recent document. The function returns 0 if the specified time is in the future.

4. Scenarios:

Scenario 1: For timeliness, use the create_timestamp field in the fine-grained sort and timeliness_ms(create_timestamp) in the rough sort expression.

5. Notes:

  • Configure the pubtime field as a property field.

  • This function can be used in both rough sort and fine sort expressions.