# Multi\_Match Vs Query\_String\_Query?

**URL:** <https://discuss.elastic.co/t/multi-match-vs-query-string-query/298892>\
**Category:** Elasticsearch\
**Created:** [March 5, 2022, 1:46pm UTC](https://discuss.elastic.co/t/multi-match-vs-query-string-query/298892 "2022-03-05T13:46:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nishikant\_Tayade](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nishikant_tayade/32/84159_2.png) [@Nishikant\_Tayade](https://discuss.elastic.co/u/Nishikant_Tayade)\
**Post date:** [March 5, 2022, 1:46pm UTC](https://discuss.elastic.co/t/multi-match-vs-query-string-query/298892/1 "2022-03-05T13:46:49Z")

</div>

I am using ES 7.10.2

I have fields with keyword and text mappings.

When user specifies the search string, I wanted to parse the pieces of search string, for each specific field, in the specific way that field mapping is configured, such that using same analyzer as provided in field mapping.

For this requirement I am using Query-String-Query, I validate the above statement using \_validate query.

But the same is also seems to be true, regarding Multi\_Match query.

See below example:

```auto
POST /testindex/_doc/1
{"id":1,"firstname":"john","middlename":"clark","lastname":"smith"}

POST /testindex/_doc/2
{"id":2,"firstname":"john","middlename":"paladini","lastname":"miranda"}

```

Now if I execute the validate queries.

```auto
GET testindex/_validate/query?pretty=true&explain=true
{
   "query": {
     "multi_match" : {
      "operator" : "and",
      "fields" : [
         "firstname",
         "lastname"
      ],
      "query" : "john smith"
   }
   }
}

GET testindex/_validate/query?pretty=true&explain=true
{
   "query": {
    "query_string": {
      "default_operator": "and",
      "fields" : [
         "firstname",
         "lastname"
      ],
      "query" : "john smith"
    }
   }
}

```

Result of both the queries are same:

```auto
{
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "failed" : 0
  },
  "valid" : true,
  "explanations" : [
    {
      "index" : "testindex",
      "valid" : true,
      "explanation" : "((+firstname:john +firstname:smith) | (+lastname:john +lastname:smith))"
    }
  ]
}

```

I know QSQ having capability of having special char of certain op

besides that what is the difference then for above requirement ? is there any diff when operator is "OR" ? or "AND" ?

---

<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:** [April 2, 2022, 1:47pm UTC](https://discuss.elastic.co/t/multi-match-vs-query-string-query/298892/2 "2022-04-02T13:47:21Z")

</div>

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