I've got a 'post' index, which has a 'createdAt' date field.
I'm trying to create a query that will return all posts, however, it should apply negative scoring for every day from now to the past.
So, if a post was created today, the scoring would be unaffected, but a post created for example 5 days ago, should have -5 penalty applied. So for every day it would have an extra -1 score applied.
I've tried to achieve this with "linear" decay function but it seems to cover only a very specific date range and I'm rather looking for something more open.
Thanks in advance