gpt4 book ai didi

elasticsearch - token 生成器是否可用于Elasticsearch中的索引编制或查询?

转载 作者:行者123 更新时间:2023-12-02 22:54:30 24 4
gpt4 key购买 nike

我正在Elasticsearch 6.8中查看tokenizer。我知道它定义了我们在建立索引时如何将文本标记为单词。例如,它将转换为“Quick brown fox!”。将文字转换为[Quick, brown, fox!]
如果我在Elasticsearch中有一个文本为"Quick brown fox!"的字段,它将在索引中分为三个词。
但是,如果我发送查询文本"Quick brown fox!"tokenizer是否也适用于该查询参数怎么办?

最佳答案

只要在索引的字段映射中正确配置了分析器,分析器就可以在索引时间和查询时间工作。

On this page,您将获得有关分析仪启动时间的完整描述,为清楚起见,以下重复进行:

At index time, Elasticsearch will look for an analyzer in this order:

  • The analyzer defined in the field mapping.
  • An analyzer named default in the index settings.
  • The standard analyzer.

At query time, there are a few more layers:

  • The analyzer defined in a full-text query.
  • The search_analyzer defined in the field mapping.
  • The analyzer defined in the field mapping.
  • An analyzer named default_search in the index settings.
  • An analyzer named default in the index settings.
  • The standard analyzer.


因此,您可以看到,在提取数据和查询数据时都可以利用分析器。

关于elasticsearch - token 生成器是否可用于Elasticsearch中的索引编制或查询?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59871454/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com