Configure elasticsearch mapping with java api

后端 未结 4 1412
说谎
说谎 2020-12-10 13:56

I have a few elasticsearch fields that I don\'t want to analyze before indexing. I have read that the right way to do this is by altering the index mapping. Right now my map

4条回答
  •  孤街浪徒
    2020-12-10 14:46

    Just read the Definitive Guide carefully:

    Although you can add to an existing mapping, you can’t change existing field mappings. If a mapping already exists for a field, data from that field has probably been indexed. If you were to change the field mapping, the indexed data would be wrong and would not be properly searchable.

    Source: https://www.elastic.co/guide/en/elasticsearch/guide/current/mapping-intro.html#updating-a-mapping

    So you just have to do it when you create the field. Thats why the code from this answer works without problems.

提交回复
热议问题