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

后端 未结 4 1144
星月不相逢
星月不相逢 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:54

    I think updating the mapping is wrong approach just to handle a field for reporting purposes. Sooner or later you may want to be able to search the field for tokens. If you are updating the field to "not_analyzed" and want to search for foo from a value "foo bar", you won't be able to do that.

    A more graceful solution is to use kibana aggregation filters instead of terms. Something like below will search for the terms ivr04 and ivr02. So in your case you can have a filter "Hello I'm Sinha". Hope this helps.

提交回复
热议问题