<!-- Source: https://docs.squirro.com/en/latest/technical/search/relevancy/scoring-plugins/_autosummary/squirro.lib.search.relevancy.plugins.recommend.content.recommenders.RecencyBoost.html -->
# 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](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)`
- `query_score_mode (squirro.lib.search.relevancy.interface.QueryScoreMode)`
- `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 by name)

**`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

**`field PluginConfig.query_score_mode: QueryScoreMode = QueryScoreMode.sum`**

Whether this boost should be applied in an additive or multiplicative manner. Only applicable on the query stage.
