RecencyBoost#

class RecencyBoost#

recency_boost | Make recent documents more relevant

  • Rank on squirro Item’s native date fields “item_created_at”, “modified_at”, “created_at”.

  • Or by any Label of type date_time (by using the internal name of the Label)

For explanation on decay function see: https://www.elastic.co/blog/found-function-scoring#decay-functions-in-elasticsearch

pydantic model PluginConfig#
Fields
  • date_field (str)

  • decay (float)

  • offset (str)

  • origin (str)

  • scale (int)

PluginConfig.plugin_name: ClassVar[str] = 'recency_boost'#

Used to register and reference the plugin within a query.

field PluginConfig.date_field: str = 'item_created_at'#

Datetime field to use for recency boosting (with support for datetime facets)

field PluginConfig.decay: float = 0.3#

Gaussian decay factor

field PluginConfig.origin: str = 'now'#

Origin of pivot function. Datetime or now

field PluginConfig.scale: int = 730#

Gaussian decay applied to range of days

field PluginConfig.offset: str = '0'#

Date range syntax. Boosting value of 1 from origin to offset. Decay is applied between offset to scale