Sachin
Sachin

Reputation: 359

Elastic search index mapping updation

I am using ES-2.4.0
Indexed json :
{ "_id": 1, "name": "Longsword", "description": "The Longsword can be wielded in one or two hands", "category": "Sharp" }

1.I have created an index and the default mapping is being created.
2.Now i am trying to update the mapping as suggested here.

Link : https://gist.github.com/nicolashery/6317643

Regarding point 1 : i have not used any analyzer ;
Regarding point 2 : i am using analyser "not_analysed" ;

But it is not working .

Question : Has ES-2.X stopped mapping updation facility if not how can i update the mapping ?

Note : While trying i am getting this error

{ "error": { "root_cause": [ { "type": "illegal_argument_exception", "reason": "Mapper for [name] conflicts with existing mapping in other types:\n[mapper [name] has different [analyzer]]" } ], "type": "illegal_argument_exception", "reason": "Mapper for [name] conflicts with existing mapping in other types:\n[mapper [name] has different [analyzer]]" }, "status": 400 }

Upvotes: 0

Views: 176

Answers (1)

ChintanShah25
ChintanShah25

Reputation: 12672

No, changing mapping type of existing fields are not allowed ES 2.x onwards.

From the documentation

In general, the mapping for existing fields cannot be updated. There are some exceptions to this rule. For instance:

  • new properties can be added to Object datatype fields.
  • new multi-fields can be added to existing fields.
  • doc_values can be disabled, but not enabled.
  • the ignore_above parameter can be updated.

You would have to first delete the index and create a new one with new mapping. Also there is a minor typo, it is not_analyzed("z" not "s")

Upvotes: 2

Related Questions