# Multi\_match on multiple indexes

**URL:** <https://discuss.elastic.co/t/multi-match-on-multiple-indexes/91327>\
**Category:** Elasticsearch\
**Created:** [June 29, 2017, 5:40pm UTC](https://discuss.elastic.co/t/multi-match-on-multiple-indexes/91327 "2017-06-29T17:40:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![naoko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/naoko/32/11822_2.png) [@naoko](https://discuss.elastic.co/u/naoko)\
**Post date:** [June 29, 2017, 5:40pm UTC](https://discuss.elastic.co/t/multi-match-on-multiple-indexes/91327/1 "2017-06-29T17:40:58Z")

</div>

I have 2 indexes that I want to multi\_match fields  
each indexes has different fields (schema)  
for instance, idx1 has "subject" and "html\_body" and idex2 has "subject" and "detail".

I have query like this

```auto
    {
    	"query": 
    		{"multi_match": {
    			"query": "unverse mars", 
    			"fields": ["html_body", "subject", "detail"], 
    			"type": "cross_fields"}
    			}
    		}
    }

```

2 of 3 fields ("html\_body" and "detail") are using the same analyzer and I want to use 'cross\_fields'

and explain shows:

```
"explanations" : [
    {
      "index" : "idx1",
      "valid" : true,
      "explanation" : "(detail:unvers detail:mar) (blended(terms:[html_body:unverse, subject:unverse]) blended(terms:[html_body:mars, subject:mars]))"
    },
    {
      "index" : "idx2",
      "valid" : true,
      "explanation" : "(detail:unverse detail:mars) (html_body:unvers html_body:mar) (subject:unverse subject:mars)"
    }
  ]

```

I also tried with 3 fields that are using same analyzer and shows the similar result - only one index is using `blended`

it lists all the fields on each index (understandable) and one shows `blended` and 2nd index doesn't. Could you help me explain why idx2 is not using blended?

---

<div class="post-metadata">

**Author:** ![s1monw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s1monw/32/3637_2.png) [@s1monw](https://discuss.elastic.co/u/s1monw)\
**Post date:** [July 7, 2017, 7:23am UTC](https://discuss.elastic.co/t/multi-match-on-multiple-indexes/91327/2 "2017-07-07T07:23:39Z")

</div>

are you sure that `detail` and `subject` have the same analyzers?

---

<div class="post-metadata">

**Author:** ![naoko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/naoko/32/11822_2.png) [@naoko](https://discuss.elastic.co/u/naoko)\
**Post date:** [July 9, 2017, 12:20am UTC](https://discuss.elastic.co/t/multi-match-on-multiple-indexes/91327/3 "2017-07-09T00:20:56Z")

</div>

Thank you for your reply!  
Yes, well I realized that subject wasn't ☹ so I picked 3 fields that has same analyzer.  
The fields name are: `html_body` , `sanitized_body`, and `detail`.

Here is the result of inspecting fields:

```auto
Index: idx1
Text Fields: ['detail[text,html_strip]', 'subject[text,None]']

Index: idx2
Text Fields: ['html_body[text,html_strip]', 'sanitized_body[text,html_strip]', 'text_body[text,None]', 'to_email[text,None]']

```

and here is the analyze result:

```auto
Cross Field
{
  "valid" : true,
  "_shards" : {
    "total" : 2,
    "successful" : 2,
    "failed" : 0
  },
  "explanations" : [
    {
      "index" : "idx1",
      "valid" : true,
      "explanation" : "(sanitized_body:universe sanitized_body:mars) (detail:univers detail:mar) (html_body:universe html_body:mars)"
    },
    {
      "index" : "idx2",
      "valid" : true,
      "explanation" : "(detail:universe detail:mars) (blended(terms:[html_body:univers, sanitized_body:univers]) blended(terms:[html_body:mar, sanitized_body:mar]))"
    }
  ]
}

```

---

<div class="post-metadata">

**Author:** ![s1monw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s1monw/32/3637_2.png) [@s1monw](https://discuss.elastic.co/u/s1monw)\
**Post date:** [July 10, 2017, 7:43am UTC](https://discuss.elastic.co/t/multi-match-on-multiple-indexes/91327/4 "2017-07-10T07:43:27Z")

</div>

the result looks correct to me, can you tell me what you expected? `sanitized_body:universe` in index 1 will result in no matches since the field is not mapped so you can just ignore this?

---

<div class="post-metadata">

**Author:** ![naoko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/naoko/32/11822_2.png) [@naoko](https://discuss.elastic.co/u/naoko)\
**Post date:** [July 10, 2017, 1:52pm UTC](https://discuss.elastic.co/t/multi-match-on-multiple-indexes/91327/5 "2017-07-10T13:52:57Z")

</div>

The result of "idx1" is identical to what would show in `most_field`. I was expected to see `blended` in "idx1" as well.

---

<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 7, 2017, 1:53pm UTC](https://discuss.elastic.co/t/multi-match-on-multiple-indexes/91327/6 "2017-08-07T13:53:21Z")

</div>

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