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

橙三吉。 提交于 2020-01-13 19:08:16

问题


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.


回答1:


You might want to take a look at ExternalFileField.

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



来源:https://stackoverflow.com/questions/6333067/ordering-solr-search-result-by-day-week-month-year-views

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!