I am trying to set analyzer to property of a document but process is always unsuccessful because another document has property with same name .. I am getting below error message:
{Type: illegal_argument_exception Reason: "Mapper for [departmentName] conflicts with existing mapping in other types:
[mapper [departmentName] has different [analyzer]]"}
Here is the code I am using to put mapping:
ESClientContext.Map<Department>(m => m.Index("company").Type("department")
.Properties(p => p
.Text(t => t
.Name(n => n.DepartmentName)
.Analyzer("keyword")
.Fielddata(true)
)).UpdateAllTypes(true));
Please format your code, logs or configuration files using </> icon as explained in this guide and not the citation button. It will make your post more readable.
Or use markdown style like:
```
CODE
```
There's a live preview panel for exactly this reasons.
Please update your post.
I can't really answer but please be aware that in 6.x you can't have anymore multiple mappings in the same index
So it's better to start thinking of your project a bit differently and have multiple indices for example.
I tried "</>" but preview window was not reflecting any change .. so I had to do that .. I am using Opera 51.0 browser.
multiple indices .. is gonna cost us a huge change .. I have approve 25 docs in my index .. I am using 5.5 right now .... so your suggestion is that we should create single index for single doc .. my main issue is analyzer .. I need to index the string as it is .. can you please share any solution for that which can work for me without breaking all docs to many indices? ..
One more point I want to mention .. my index is already created and I want to update the mapping of Department and Employee both .. departmentName analyzer change .. now is there any way to apply mapping change to both at once (that was actually my question, sorry the UI was not so clear to you) .. when I try to do put mapping one by one I am getting exception at first try ...
multiple indices .. is gonna cost us a huge change .. I have approve 25 docs in my index .. I am using 5.5 right now .... so your suggestion is that we should create single index for single doc ..
Yes. Be prepared for 6.x ASAP.
my main issue is analyzer .. I need to index the string as it is .. can you please share any solution for that which can work for me without breaking all docs to many indices? ..
Use a keyword analyzer or a keyword data type in your mapping.
my index is already created and I want to update the mapping of Department and Employee both .. departmentName analyzer change ..
You need to reindex for that. You can not change the settings of an existing field.
yes .. I have many types/documents in single index.
So you will be able to upgrade your existing indices to 6.x but you won't be able to upgrade to 7.x.
And you won't be able to create the same data structure from scratch in 6.x.
ok .. so I can't have Employee and Department in same index in 6.x .. but I can upgrade my old index .. but if in future I will have any requirement to reindex .. then I will have to face a huge change .. right? ...
And if now I apply changes keeping 6.x in mind . will that help me with 7.x too?
I followed your suggestion and changes my mapping to once index one type of document .. actually in my case now I have one document in one index .. now I needed to change analyzer for one on my document's text field but getting this error -
Mapper for [name] conflicts with existing mapping in other types: [mapper [name] has different [analyzer]]
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.