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.
Everything apart from the linear function seems to work fine. Just need to find a way to prioritize posts based on their number of days since they're added.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.