按日/周/月/年视图订购Solr搜索结果 [英] Ordering Solr search result by day/week/month/year views

查看:108
本文介绍了按日/周/月/年视图订购Solr搜索结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

具有视频模型并为其搜索索引。使用Django-haystack和Solr。需要按天/周/月/年的视频观看次数对结果进行排序。是否可以不总是通过最后一天/周/月/年的视图信息来更新搜索索引呢?



如果只需要按观看次数排序,则可以仅更新一天观看的视频(当前观看次数等于0)的索引。 p>

每隔几个小时使用一次update_index似乎不是一个好主意,因为现在需要30分钟,因此将来可能需要更多时间。现在搜索索引仅针对具有Celery异步任务的已更改对象进行更新。

解决方案

您可能想看看 ExternalFileField



另请参见 http://sujitpal.blogspot.com/2011/05/custom-sorting-in-solr-using-external.html


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.

解决方案

You might want to take a look at ExternalFileField.

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

这篇关于按日/周/月/年视图订购Solr搜索结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆