Data insert/update in new index fields

Hi,

i have my Elasticsearch 7.17 installed, where i have multiple indexes with data in them.

now, i want to update those indexes with new mappings & settings, and i also want that new field is present when i run search query in it.

for example:-
index "Hollywood" has an existing field "actor" with value "john", now i want to add field "movie".

now when i search with only "actor" in my query, it works, but when i search with both "actor" & "movie", it gives me error:-

"reason": {
"type": "illegal_argument_exception",
"reason": "no mapping found for field [movie]"
}

i understand that there is no data in the field "movie", but atleast it should not fail with an exception

Welcome!

Could you provide a full recreation script as described in About the Elasticsearch category. It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script is something anyone can copy and paste in Kibana dev console, click on the run button to reproduce your use case. It will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

Have a look at the Elastic Stack and Solutions Help · Forums and Slack | Elastic page. It contains also lot of useful information on how to ask for help.