分享Whoosh指数
我正在 Django 中实现一个 CMS 网站,我想添加全文内容搜索。该网站相当小,并且产生的搜索流量较低,因此我认为 Whoosh 将是一个合理的生产解决方案。
我目前的理解是 Whoosh 索引和结果生成发生在应用程序进程中,而不需要它自己的守护进程,这很棒。但是,我有点担心索引的并发访问。单个 Whoosh 索引能否支持从多个不协调的进程读取(并可能写入)?例如,如果负载平衡的 Django 应用程序服务器共享相同的索引,是否会出现严重的性能下降或索引损坏的问题?
预先感谢您的建议。
I'm implementing a CMS site in Django, and I'd like to add full-text content search. The site is reasonably small and will generate low search traffic, so I think Whoosh will be a reasonable production solution.
My current understanding is that the Whoosh indexing and result generation happens in the application process, rather than requiring its own daemon, which is great. However, I'm a bit worried about concurrent access to the index. Can a single Whoosh index support reads (and potentially writes) from multiple, uncoordinated processes? For example, will it be problematic if the same index is shared by load-balanced Django application servers, either in terms of serious performance degradation or index corruption?
Thanks in advance for your advice.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 Whoosh 文档,似乎可以在多个线程/进程之间共享索引。有关索引的文档位于: http://packages.python.org/Whoosh/indexing .html#indexing-documents 表示索引在更新时被锁定以进行写入,因此我认为高度读取的应用程序基本上没问题。
It appears, based on the Whoosh documentation, that it is possible to share an index between several threads/processes. The docs on indexing here: http://packages.python.org/Whoosh/indexing.html#indexing-documents indicate that the index is locked for writes when updating it, so I'd imagine that a highly read-heavy application would be mostly ok.