timeliness

更新时间:
复制 MD 格式

Feature functions

Feature functions can be used in sort expressions to create powerful sorting features. Most of these functions are supported only in fine sort expressions.

Document fields that are used as parameters in a feature function must be configured as an index or a property, as specified in the documentation for that function.

timeliness: A timeliness score that measures the recency of a document

1. Usage details:

timeliness(pubtime)

2. Parameters:

pubtime: The field to evaluate. The data type must be int32 or int64. The unit is seconds.

3. Return value:

The function returns a float value in the range of [0, 1]. A larger value indicates a more recent document. If the specified time is later than the current time, the function returns 0.

4. Scenarios:

Scenario 1: Evaluate the timeliness of the create_timestamp field by adding timeliness(create_timestamp) to a sort expression.

5. Notes:

  • Configure the pubtime field as a property field.

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