简体   繁体   English

干草堆+弹性搜索如何工作?

[英]How haystack + elastic search work?

I have added taggit application to add tags to some user message. 我已经添加了taggit应用程序,以将标签添加到某些用户消息中。

tags = TaggableManager()  

When i index the message and tags in searchindex.py 当我在searchindex.py中索引邮件和标签时

text = indexes.EdgeNgramField(document=True, use_template=True)
message = indexes.CharField(model_attr='message')
tags = indexes.CharField(model_attr='tags')

When in search i search by any tag , by default it show all the messages associated with tag. 在搜索中,我通过任何标签进行搜索,默认情况下,它会显示与标签关联的所有消息。 Anyone can help how haystack and elastic search index the columns? 任何人都可以帮助大海捞针和弹性搜索索引列吗? where it makes any AND relations to the search columns ? 它与搜索列之间有何AND关系?

I got the answer. 我得到了答案。 What ever i include in my data template can be searched . 可以搜索我包含在数据模板中的内容。 And i have to include tag in data template to make the user search by tag name and display the message. 而且我必须在数据模板中包括标签,以使用户通过标签名称进行搜索并显示消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM