Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ordering Solr search result by day/week/month/year views

Have Video model and search index for it. Django-haystack and Solr are used. It is needed to sort result by video's views for day/week/month/year. Is it possible to this without always updating of search index by information of views for last day/week/month/year?

If need only sort by view for day and total, then it can be possible update index only for videos viewed for one day, which have current views equal 0.

Using update_index every few hours looks like not good idea, because now it takes 30 min so in future can take much more. Now search index is update only for changed objects with Celery asynchronous task.

like image 788
Kriplins Avatar asked Sep 03 '25 05:09

Kriplins


1 Answers

You might want to take a look at ExternalFileField.

See also http://sujitpal.blogspot.com/2011/05/custom-sorting-in-solr-using-external.html

like image 68
Mauricio Scheffer Avatar answered Sep 05 '25 00:09

Mauricio Scheffer