# Correlating data across indices

**URL:** <https://discuss.elastic.co/t/correlating-data-across-indices/116755>\
**Category:** Elasticsearch\
**Created:** [January 23, 2018, 9:38pm UTC](https://discuss.elastic.co/t/correlating-data-across-indices/116755 "2018-01-23T21:38:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chimbo84](https://avatars.discourse-cdn.com/v4/letter/c/858c86/32.png) [@chimbo84](https://discuss.elastic.co/u/chimbo84)\
**Post date:** [January 23, 2018, 9:38pm UTC](https://discuss.elastic.co/t/correlating-data-across-indices/116755/1 "2018-01-23T21:38:02Z")

</div>

I know I will probably need the \_msearch API to do this but am having trouble accomplishing my goal.

I have two indices (Index1 and Index2) that each have a term I am trying to correlate. Basically, I want to find documents where Index1:TermA = Index2:TermB.

I have tried using the following:

> ```
> GET /Index1,Index2/_search
> {
> "query": {
> "bool": {
> "should": [
> {
> "term": {
> "TermA.keyword": "*"
> }
> },
> {
> "term": {
> "TermB.keyword": "*"
> }
> }
> ]
> }
> }
> }
> 
> ```

---

<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:** [February 20, 2018, 9:38pm UTC](https://discuss.elastic.co/t/correlating-data-across-indices/116755/2 "2018-02-20T21:38:22Z")

</div>

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