# Payload multi indices

**URL:** <https://discuss.elastic.co/t/payload-multi-indices/192847>\
**Category:** Elasticsearch\
**Created:** [July 30, 2019, 7:53am UTC](https://discuss.elastic.co/t/payload-multi-indices/192847 "2019-07-30T07:53:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nitingarg](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@nitingarg](https://discuss.elastic.co/u/nitingarg)\
**Post date:** [July 30, 2019, 7:53am UTC](https://discuss.elastic.co/t/payload-multi-indices/192847/1 "2019-07-30T07:53:58Z")

</div>

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"  
}  
}  
]  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 1, 2019, 1:39pm UTC](https://discuss.elastic.co/t/payload-multi-indices/192847/2 "2019-08-01T13:39:18Z")

</div>

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](https://www.elastic.co/guide/en/elastic-stack-overview/7.2/input-chain.html), 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

---

<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 29, 2019, 1:39pm UTC](https://discuss.elastic.co/t/payload-multi-indices/192847/3 "2019-08-29T13:39:27Z")

</div>

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