Add new field with value from existent fields

Versions (relevant - OpenSearch: 3.x/Dashboard: devTools/Server OS: Serverless/Browser: Edge Version 151.0.4129.59):

Describe the issue:
Hello everyone, I am new to opensearch and I have a problem
Our document contains an array like this:

"outerList": \[{
"innerList": \[{
    "field1": "value1",
    "field2": "value2",
    "field3": "value3",
    "field4": "value4"
}, {
    "field1": "value1b",
    "field2": "value2b",
    "field3": "value3",
    "field4": "value4b"
},

...\]

when we search by field2:value2 & field3:value3, the result returns both items (the list contains thousand of items so it returns more than expected).

We were thinking about adding a new field, field5 with value field2.value:field3.value, so we will have 2 separate field5 with different values

field5: “value2:value3” and field5: “value2b:value3”

and then searching for field5:value5.

we are testing via python but we get TO even after increasing memory and TO.
Is it possible to create a script that fetch the value of field2 and field3 and add it to the new field5 and run it directly in openSearch dashboard for the update?

Documentation show only simple examples

I hope all the info are correct.

Thanks

Configuration:

Relevant Logs or Screenshots:

Hi @marcode,welcome to our community!

Could you please share the current index mapping?

GET /your-index/_mapping

Also, when you say that the query returns both items, do you mean that both objects are treated as matches, or that the returned document contains the entire innerList?Do you expect the response to contain only the single matching object from innerList?

If possible, could you also share the query you’re using and a sample response, with any sensitive information redacted.