让我们假设,如果您想将hello world in Elasticsearch存储在title中,并想在搜索结果中找到它,当您在标题中使用任何单词进行搜索时,例如:hello或world或Elasticsearch ..那么你需要在ElasticSearch倒排索引中有这些搜索词的标记。 默认情况下,所有Elasticsearch文本字段都要经过text analysis(为输入文本创建标记(纯英语世界))。 在我们的示例中,给定的标题将生成以下标记,您还可以使用以下API验证自己
GET http://es:9200/_analyze
{
"text" : "hello world in Elasticsearch",
"analyzer": "standard"
}
1条答案
按热度按时间7fyelxc51#
让我们假设,如果您想将
hello world in Elasticsearch
存储在title
中,并想在搜索结果中找到它,当您在标题中使用任何单词进行搜索时,例如:hello
或world
或Elasticsearch
..那么你需要在ElasticSearch倒排索引中有这些搜索词的标记。默认情况下,所有Elasticsearch文本字段都要经过text analysis(为输入文本创建标记(纯英语世界))。
在我们的示例中,给定的标题将生成以下标记,您还可以使用以下API验证自己
和结果令牌
现在存储意味着一个字段的完整字符串aka(未标记)
hello world in Elasticsearch
,它对全文搜索没有用处,如Elasticsearch文章中所解释的,默认存储****作为_source
的一部分。希望这对你有帮助。