# Multi\_match/query string with nested and "non-nested" fields

**URL:** <https://discuss.elastic.co/t/multi-match-query-string-with-nested-and-non-nested-fields/118652>\
**Category:** Elasticsearch\
**Created:** [February 6, 2018, 1:30pm UTC](https://discuss.elastic.co/t/multi-match-query-string-with-nested-and-non-nested-fields/118652 "2018-02-06T13:30:05Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![YeeP](https://avatars.discourse-cdn.com/v4/letter/y/41988e/32.png) [@YeeP](https://discuss.elastic.co/u/YeeP)\
**Post date:** [February 6, 2018, 3:50pm UTC](https://discuss.elastic.co/t/multi-match-query-string-with-nested-and-non-nested-fields/118652/6 "2018-02-06T15:50:13Z")

</div>

Here is one that also combines a nested, nested object. Seems to function as expected. Keep in mind the application for this would be a "global search" for the front end where the user is searching through multiple fields with the same string. I recognize how this could be done better by defining data specific to the fields in question, which we will also do in a different part of the site.

```
GET /sev_incidents/object/_search
{
    "query": {
      "bool": {
        "should": [
          {"query_string" : {
            "query" : "*ALBANY* AND open:false",
            "fields": ["number"]
            }
          },
          {
            "nested" : {
            "path" : "update",
            "score_mode" : "avg",
            "query": {
              "query_string" : {
                "query" : "*ALBANY*",
                "fields": ["update.level", "update.subject_line"]
              }
            }
            }
          },
          {
            "nested" : {
            "path" : "update.sites",
            "score_mode" : "avg",
            "query": {
              "query_string" : {
                "query" : "*ALBANY*",
                "fields": ["update.sites.name"]
              }
            }
        }
          }
        ]
      }
    }
}

```

Thanks again for the help!

---

_[View the full topic](https://discuss.elastic.co/t/multi-match-query-string-with-nested-and-non-nested-fields/118652)._
