Freshness: boosting based on the age of content

We have a repository of files spanning back 15 years. It’s not uncommon to have the same subject area re-hashed year on year. Especially if its a change in the law around that practice area, etc.

In most instances, content matching keywords from docs that are more recent is most relevant. However, with such a large index of documents, recent documents that are most relevant to the user are drowned out by older documents deemed more relevant by the index. Users can re-sort by date but then the relevancy score is made useless.


On Azure Search they have a “freshness” option for index attributes:

freshness
The freshness scoring function is used to alter ranking scores for items based on values in DateTimeOffset fields. For example, an item with a more recent date can be ranked higher than older items.

Note that it is also possible to rank items like calendar events with future dates such that items closer to the present can be ranked higher than items further in the future.

In the current service release, one end of the range will be fixed to the current time. The other end is a time in the past based on the boostingDuration. To boost a range of times in the future, use a negative boostingDuration.

The rate at which the boosting changes from a maximum and minimum range is determined by the Interpolation applied to the scoring profile (see the figure below). To reverse the boosting factor applied, choose a boost factor of less than 1.


Is there an equivalent feature in Algolia? Or is there a standard way of simulating this type of boosting/scoring?

Hi there,

Algolia takes a different approach to sorting documents in the engine. It uses a tie-break algorithm which sounds very natural for implementing this concept. With the custom-ranking you can add the date.

Cheers,

1 Like

I can’t see any mention of date data types on the custom ranking page.

https://www.algolia.com/doc/guides/ranking/custom-ranking/#custom-ranking-overview

Can we include a date property as an actual date and rank desc(mydatefield)?

Or would we need to convert the date to something like an epoch time and use that value in the index instead?

Hi @geoff,

To use custom ranking on a date field, you will have to first convert the date to UNIX timestamp in your records, then you can utilize desc(your_date_field) for custom ranking.

Cheers,