弹性中的字段设置为not_analyzed,但似乎仍在分析中

时间:2018-07-23 15:57:11

标签: symfony elasticsearch

这是我对fos_elastica进行Elasticsearch的配置:

api_items:
  client: default
  use_alias: true
  settings:
    analysis:
      analyzer:
        custom_analyzer:
          type: custom
          tokenizer:  keyword
          filter: ["asciifolding", "lowercase"]
      types:
        all_data:
          mappings:
            custom_name: {"type" : "string", "fields": {"raw": {"type" : "string", "index" : "not_analyzed"}, "keyword": {"type" : "string", "analyzer": "custom_analyzer"}}}

custom_name.raw中有一些项目,例如

“快乐的字符串”

当我尝试按字词搜索 all_data.custom_name.raw

“快乐的好字符串” 作为术语或“快乐的好字符串” ,搜索将不会返回任何内容。当我使用“快乐的好字符串*” 作为通配符进行搜索时,我只会得到结果。

因此,似乎 all_data.custom_name.raw 进行了某种方式的分析,甚至明确指出了不应该这样做。

我在这里想念东西吗?

0 个答案:

没有答案