Change default mapping of string to “not analyzed” in Elasticsearch

后端 未结 4 1145
星月不相逢
星月不相逢 2020-11-29 23:29

In my system, the insertion of data is always done through csv files via logstash. I never pre-define the mapping. But whenever I input a string it is always taken to be

4条回答
  •  北荒
    北荒 (楼主)
    2020-11-29 23:34

    You can query the .raw version of your field. This was added in Logstash 1.3.1:

    The logstash index template we provide adds a “.raw” field to every field you index. These “.raw” fields are set by logstash as “not_analyzed” so that no analysis or tokenization takes place – our original value is used as-is!

    So if your field is called foo, you'd query foo.raw to return the not_analyzed (not split on delimiters) version.

提交回复
热议问题