# Migrating from Elastic Search 5.x to 6.x broke this query and I would like to understand why

**URL:** https://discuss.elastic.co/t/migrating-from-elastic-search-5-x-to-6-x-broke-this-query-and-i-would-like-to-understand-why/177168
**Category:** Elasticsearch
**Created:** [April 16, 2019, 11:27pm UTC](https://discuss.elastic.co/t/migrating-from-elastic-search-5-x-to-6-x-broke-this-query-and-i-would-like-to-understand-why/177168 "2019-04-16T23:27:39Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![dcemgs](https://avatars.discourse-cdn.com/v4/letter/d/da6949/32.png) [@dcemgs](https://discuss.elastic.co/u/dcemgs)
#### Post date: [April 16, 2019, 11:27pm UTC](https://discuss.elastic.co/t/migrating-from-elastic-search-5-x-to-6-x-broke-this-query-and-i-would-like-to-understand-why/177168/1 "2019-04-16T23:27:39Z")

</div>

Hello,

Assume an index with a "person" type with firstName, lastName and homePhone, workPhone, address, etc. fields.

We have this query running on Elastic Search 5.x

```json
{
  "query": {
    "bool": {
      "must": [
        { "query_string": { "query": "aFirstName aLastName 5556668888", "all_fields": "true", "default_operator": "and" }}
      ],
      "filter": [
        {
          "term": {
            "aCertainField": {
              "value": 2
            }
          }
        }
      ]
    }
  }
}

```

As I understand, this used to search each term across all fields and return whatever was the best match.

Running the same query in 6.x doesn't return anything. I feel it has something to do with the `_all`field disappearing but I can't put my finger on how to implement the same functionality.

The use case is a search box to search a wide array of different types and we want each term to be looked up against each field. I looked up multi term/multi field queries but it looks like I have to know in advance what each term is (first term is a firstname, second term is a last name, third term is a phone number, etc.) and I don't have such knowledge in advance.

Any help would be greatly appreciated, thanks!

---

<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: [May 14, 2019, 11:27pm UTC](https://discuss.elastic.co/t/migrating-from-elastic-search-5-x-to-6-x-broke-this-query-and-i-would-like-to-understand-why/177168/2 "2019-05-14T23:27:52Z")

</div>

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