Payload multi indices

I want to use first indices output m_id as input second indices
ind1,ind2/_search
{
"query": {
"bool": {
"should": [
{
"term": {
"linked_m_id": "11197"
}
},
{
"term": {
"m_id": "ctx.payload.hits.hits.0.fields.m_id"
}
}
]
}
}
}

Hey,

first please use proper formatting. This forum supports markdown syntax, allowing you to make code snippets much more readable.

second, please take some additional time to explain your use-case properly. Judging from the sample I can only assume that you are using watcher.

If this is the case look at the chain input, which allows you to use the input of the first query, then transform the input and then use it in another query.

If you have further questions, please include fully reproducible examples.

Thank you!

--Alex