Haystack Elasticsearch显示没有结果Django

时间:2017-05-22 14:47:16

标签: django elasticsearch django-haystack

您好我正在尝试对我的(本地)网站实施搜索并使用Haystack。对于Backend,我选择了Whoosh,它有点工作(我得到了一些结果,但没有我想要的那么多)所以我试图切换到Elasticsearch,因为有更多的支持和活跃的用户。我让Elasticsearch在Port 9200(版本5.4.0)上运行。

当我运行./manage.py haystack_info

时,

Number of handled 3 index(es). - Model: Tag by Index: <my_profile.search_indexes.TagIndex object at 0x10ff51ae0> - Model: UserProfile by Index: <my_profile.search_indexes.UserIndex object at 0x10ff51c18> - Model: Post by Index: <my_profile.search_indexes.PostIndex object at 0x10ff51db8> 正在运作

search_indexes.py

问题是Haystack找不到任何结果,无论我搜索什么。它必须是Elasticsearch的东西,因为我之前得到了Whoosh的结果。我有一个Post_text.txt文件,而{{1}}位于右侧文件夹中。

当我运行$ curl -XGET&#39; http://127.0.0.1:9200/PostIndex/_mapping?pretty=1&#39;在终端中,他向我显示未找到索引的错误。这似乎是Elasticsearch版本5.x的问题,recommended使用版本2.x或1.x.

有人知道我能做些什么来获得结果吗?我应该降级到2.4,如果是的话,我需要重新安装所有内容,或者是否有快捷方式,因为让它运行一次并不是一个有趣的时间。

我希望有人可以帮助我。

0 个答案:

没有答案