我已经建立了一个django项目,现在想包括一个非数据库搜索,haystack和elasticsearch作为后端。在索引中,我使用EdgeNgramFields作为文本。一切正常,只是搜索结果太多了。我已经阅读了关于http://django-haystack.readthedocs.org/en/latest/的文档,但找不到设置关联选项的可能性。在
在关于提升的部分,他们在谈论得分。所以基本上我想有能力定义一个最低分数。但我找不到对结果的现场评分的解释。在
我错过了什么?有什么地方可以做吗,我所说的?在
Tags:
如果不知道确切的映射和示例数据,就很难告诉您为什么搜索返回太多结果。但是,我假设您的edgengram标记器使用非常小的子字符串开始大小,如1或2。在这样的设置下,有很多匹配项,例如,如果您的短语的起始大小为1:
它将按以下方式标记:
^{pr2}$这可能会为一个查询生成许多匹配项。作为解决方案,您可以使用另一个起始大小和模糊搜索来找到类似的结果。在
但首先,请提供准确的数据映射、示例数据和查询。在
下面提供了一个自定义后端的示例。关键部分是自定义配置部分底部的自定义类型和build\u schema函数。在
自定义后端配置示例:
自定义后端示例:
相关问题 更多 >
编程相关推荐