How to not-analyze in ElasticSearch?

前端 未结 3 1126
攒了一身酷
攒了一身酷 2020-11-30 01:29

I\'ve got a field in an ElasticSearch field which I do not want to have analyzed, i. e. it should be stored and compared verbatim. The values will contain letters, numbers,

3条回答
  •  死守一世寂寞
    2020-11-30 02:07

    This is no longer true due to the removal of the string (replaced by keyword and text) type as described here. Instead you should use keyword type with "index": true | false.

    For Example OLD:

    {
      "foo": {
        "type" "string",
        "index": "not_analyzed"
      }
    }
    

    becomes NEW:

    {
      "foo": {
        "type" "keyword",
        "index": true
      }
    }
    

    This means the field is indexed but as it is typed as keyword not analyzed implicitly. If you would like to have the field analyzed, you need to use text type.

提交回复
热议问题