Django haystack:将一个快速索引写入 S3 存储桶?
如何配置 django 应用程序将 haystack/whoosh 索引写入 S3 存储桶?
我找不到任何有关如何继续该主题的信息。顺便说一句,我正在使用 Heroku 进行部署。
Django 存储 看起来很有前途,但文档非常薄弱。不确定我是否可以将 WHOOSH_PATH 设置为存储对象?
看到 haystack whoosh 后端文件的设置规则如下:
if self.use_file_storage and not os.access(settings.HAYSTACK_WHOOSH_PATH, os.W_OK):
raise IOError("The path to your Whoosh index '%s' is not writable for the current user/group." % settings.HAYSTACK_WHOOSH_PATH)
第 90 行- haystack/backends/whoosh_backend.py
编辑: 我放弃了 Whoosh (& 听说它速度较慢无论如何,比 Solr 好);尽管这可能是常识,但 Websolr 是在 Heroku 部署的 Django 应用程序上进行搜索的一种非常简单的方法。
How can I configure my django app to write the haystack/whoosh index to an S3 bucket?
I can't find any information on how to get going with this topic. Incidentally I am using Heroku for deployment.
Django storages looks promising, but documentation is very thin. Unsure if I could set WHOOSH_PATH as a storage object anyway?
Seeing as the haystack whoosh backend file has rules on setup like:
if self.use_file_storage and not os.access(settings.HAYSTACK_WHOOSH_PATH, os.W_OK):
raise IOError("The path to your Whoosh index '%s' is not writable for the current user/group." % settings.HAYSTACK_WHOOSH_PATH)
line 90- haystack/backends/whoosh_backend.py
EDIT: I gave up on Whoosh (& heard it slower than Solr anyway); though it is perhaps common knowledge, Websolr is a fantastically easy way to get search on your Heroku-deployed Django app.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
免责声明:我不熟悉 Haystack 和 Haystack。我在他们的网站上快速浏览了一下,但你确实在 Twitter 上对我进行了 ping,所以这是我的想法 :)
话虽如此……在我看来,S3 的延迟(即使是来自 EC2 实例)会禁止在那里存储您的搜索索引。
如果是我,我会省去自己的麻烦(如果您还没有这样做),请查看 Heroku插件页面。对于小型项目,您可以使用以下任何工具,介于免费和廉价之间:
我希望能有所帮助!
亚当
Disclaimer: I am not familiar with Haystack & Whoosh beyond the quick look I have taken at their sites, but you did ping me on Twitter, so here are my thoughts :)
That being said... it sounds to me like the latency to S3 (even from an EC2 instance) would be prohibitive to storing your search indexes in there.
If it were I, I would save myself the trouble and (if you have not done so already), take a look at the Heroku addons page. You can use any of the following for somewhere between free and cheap for small projects:
I hope the helps a little!
Adam
我没有这方面的秘诀,但您可能有兴趣了解 whoosh 如何使用 Google App Engine 解决相同情况。
http://whoosh.ca/whoosh/src/44ed3d8ad098/src /whoosh/filedb/gae.py
I don't have recipe for this but you might be interested in looking at how whoosh works around the same situation with Google App Engine.
http://whoosh.ca/whoosh/src/44ed3d8ad098/src/whoosh/filedb/gae.py