Django:干草堆或ORM [英] Django: Haystack or ORM
问题描述
对于一个项目,我实施了Haystack,但是现在我想知道使用干草堆超过ORM的优缺点。对于我的项目,我需要通过他们的标题和isbn找到书。我想Haystack更有用,如果你要做全文搜索,或者我错过了什么?
For a project I implemented Haystack but now I was wondering what the pros and cons are of using Haystack over the ORM. For my project I need to find books by their title and isbn. I guess Haystack is more useful if you have to do full text searches or am I missing something?
推荐答案
干草堆肯定更好全文搜索,还提供了一些您不会使用ORM的其他好处。以下是Haystack网站上的一些:
Haystack is certainly better for full text search, and also provides a bunch of other benefits that you won't get using the ORM. Here are some from the Haystack site:
- 拼写建议
- Faceting
- 更多类似
- 突出显示
- 搜索字词提升
- Spelling suggestions
- Faceting
- More like this
- Highlighting
- Search term boosting
除此之外,如果您希望大量的搜索,您应该使用Haystack的ORM,因为您将从DB中卸载所有这些工作(应该专注于编写和检索数据)。
Besides that, you should use Haystack over the ORM if you expect a high volume of searches, since you'll offload all that work from the DB (which should be focused on writing and retrieving your data).
这篇关于Django:干草堆或ORM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!