Adding new field in multifields of a existing field in elasticsearch index

Hello,

I am using elasticsearch 6.5.4 version
I have an index ex: testindex ,which has a field title
my index has some data,

I need to add a new analyzer to the index ,and a new field in fields of title

I closed the index

added the analyzer
added the mapping
PUT testindex/type/_mappings
{
"properties": {
"title": {
"type": "text",
"fields": {
"upper":{
"type": "text",
"analyzer" : "my_analyzer"
}
}
}
}

}
opened the index

but when I search with title.upper , I dont get any results ?

does elasticsearch provide any ways to populate the new field of multi_fields(title.upper in this case) to populate automatically from its field (title )

I get the matches for the new documents added after addig the multi field , but dont see matches for existing documents

Changes to mappings will only ever apply to new documents. If you have existing documents you will have to reindex those for the changed mappings to apply.

Hi @Christian_Dahlqvist

I found the solution for this, we need to run update_by_query on the index so that the new mapping changes gets picked up
works for me now

Thanks
Ivar..

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.