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

**URL:** <https://discuss.elastic.co/t/adding-new-field-in-multifields-of-a-existing-field-in-elasticsearch-index/191312>\
**Category:** Elasticsearch\
**Created:** [July 19, 2019, 5:23am UTC](https://discuss.elastic.co/t/adding-new-field-in-multifields-of-a-existing-field-in-elasticsearch-index/191312 "2019-07-19T05:23:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ivar/32/83691_2.png) [@ivar](https://discuss.elastic.co/u/ivar)\
**Post date:** [July 19, 2019, 5:23am UTC](https://discuss.elastic.co/t/adding-new-field-in-multifields-of-a-existing-field-in-elasticsearch-index/191312/1 "2019-07-19T05:23:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 19, 2019, 5:29am UTC](https://discuss.elastic.co/t/adding-new-field-in-multifields-of-a-existing-field-in-elasticsearch-index/191312/2 "2019-07-19T05:29:27Z")

</div>

Changes to mappings will only ever apply to new documents. If you have existing documents you will have to [reindex those](https://www.elastic.co/guide/en/elasticsearch/reference/7.2/docs-reindex.html) for the changed mappings to apply.

---

<div class="post-metadata">

**Author:** ![ivar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ivar/32/83691_2.png) [@ivar](https://discuss.elastic.co/u/ivar)\
**Post date:** [July 21, 2019, 1:44pm UTC](https://discuss.elastic.co/t/adding-new-field-in-multifields-of-a-existing-field-in-elasticsearch-index/191312/3 "2019-07-21T13:44:25Z")

</div>

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..

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 18, 2019, 1:44pm UTC](https://discuss.elastic.co/t/adding-new-field-in-multifields-of-a-existing-field-in-elasticsearch-index/191312/4 "2019-08-18T13:44:27Z")

</div>

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