Haystack 并未索引所有项目
我使用 django haystack 和 whoosh 进行全文搜索。有九种不同的模型可供索引,但是当我搜索索引条目时,似乎没有或并非全部都为某些模型建立了索引。
我在 django shell 中尝试这样做,但是当所有九个模型都被索引时,某些模型的结果为 0,而如果我只索引某些模型,则得到所有模型。
from haystack.query import SearchQuerySet
SearchQuerySet().models(OneOfMyModels).count()
例如,我有正确索引的文章模型,如果我仅为文章重建索引,则可以找到所有 1029 个项目。但是当我为所有 9 个可搜索模型重建索引时,我得到 0 个文章项结果。
我正在使用的软件版本:
- python 2.6
- django 1.3
- haystack 1.1
- whoosh 1.8
whoosh 对于索引模型或找到的项目的数量有任何限制吗?是什么导致了这种奇怪的行为?你有经历过类似的事情吗?你是怎么解决的?
I am using django haystack with whoosh for full-text search. There are nine different models to index, but when I search for indexed entries, it seems that none or not all of them get indexed for some models.
I try this at django shell, but I get 0 for some of the models when all nine models are indexed, whereas I get all of them if I index just some models.
from haystack.query import SearchQuerySet
SearchQuerySet().models(OneOfMyModels).count()
For example, I have Article model which is correctly indexed and all 1029 items are found if I rebuild index just for Article. But I get 0 results of Article items, when I rebuild index for all 9 my searchable models.
Versions of software that I am using:
- python 2.6
- django 1.3
- haystack 1.1
- whoosh 1.8
Are there any limitations in whoosh for the amount of indexed models or found items? What could cause such strange behavior? Have you experienced anything similar? How did you solve it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当我将 Whoosh 降级到 1.3.3 时,Haystack 搜索似乎运行良好。
Haystack search seems to work well when I downgrade whoosh to 1.3.3.