同义词如何在elasticsearch中内部工作?
不久前,我遇到了Elasticsearch,并开始探索它。我知道同义词功能
太棒了!有人可以解释整个同义词过程的内部如何工作吗?分析和搜索时间同义词分析的索引时间同义词在内部结构方面有何不同?
谢谢 :)
I came across with Elasticsearch some time ago and started exploring it. I got to know about synonyms feature
which is amazing! Can someone explain how internally this whole synonyms process work? How index time synonyms analyzing and search time synonyms analyzing are different in terms of internal structure?
Thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
弹性文档:
当您使用search_analyzer同义词时,您将在搜索时间内生成搜索词的同义词令牌。
当您在索引时间使用同义词时,您将术语扩展到同义词的其他术语,也就是说,倒置索引中的所有内容都存在。当您索引更多术语时,这可能会减少存储空间。
iNdextime示例:
测试:
结果:
看,笔记本电脑和笔记本的术语已被索引,但是笔记本是同义词。
Elastic Doc:
When you use the search_analyzer synonyms, you are generating the synonym tokens for the search term just in search time.
When you use synonyms at indexing time, you are expanding the term to the other terms of the synonyms, that is, everything is there in the inverted index. This can decrease your storage as you are indexing more term.
IndexTime example:
Test:
Results:
Look, the terms laptop and notebook have been indexed, but notebook is a synonym.