Order Solr search results by day / week / month / year

You have a video model and a search index. Used by Django-haystack and Solr. This is necessary to sort the results by video views per day / week / month / year. Is this possible without constantly updating the search index for view information for the last day / week / month / year?

If you only need to sort by presentation for the day and everything, then it may be possible to update the index only to watch videos for one day, which have current views equal to 0.

Using update_index every few hours doesn’t look very good, because now it takes 30 minutes, so much more may be needed in the future. Now the search index is updated only for modified objects with the Celery asynchronous task.

+3
source share

Source: https://habr.com/ru/post/903264/


All Articles