# How does multi matching with \_all work?

**URL:** <https://discuss.elastic.co/t/how-does-multi-matching-with-all-work/104121>\
**Category:** Elasticsearch\
**Created:** [October 16, 2017, 4:27pm UTC](https://discuss.elastic.co/t/how-does-multi-matching-with-all-work/104121 "2017-10-16T16:27:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nina\_s](https://avatars.discourse-cdn.com/v4/letter/n/7ea924/32.png) [@Nina\_s](https://discuss.elastic.co/u/Nina_s)\
**Post date:** [October 16, 2017, 4:27pm UTC](https://discuss.elastic.co/t/how-does-multi-matching-with-all-work/104121/1 "2017-10-16T16:27:47Z")

</div>

Hi everyone, I wanted to know how multi matching with \_all work. Let 's say I have the following query:

```
"multi_match": {
                                    "query": x,
                                     "type": "phrase",
                                     "fields":"_all",   
                                 }

```

Does it search all available fields for the particular phrase and returns a record if the phrase exists in all fields? What if some of the fields have it and some other do not?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 16, 2017, 8:38pm UTC](https://discuss.elastic.co/t/how-does-multi-matching-with-all-work/104121/2 "2017-10-16T20:38:06Z")

</div>

`_all` field has been removed in 6.0.

What it was doing before was just collecting all values from other fields and indexing it in a flat way.

Not ideal IMO.

Better to use something like:

```auto
{
  "query": {
    "multi_match" : {
      "query": x, 
      "fields": ["field1", "field2"] 
    }
  }
}

```

Where you need to have the phrase in one of the fields at least.

---

<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:** [November 13, 2017, 8:38pm UTC](https://discuss.elastic.co/t/how-does-multi-matching-with-all-work/104121/3 "2017-11-13T20:38:40Z")

</div>

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