# Exact difference between "Query\_string" query and "multi\_match" query with cross\_fields

**URL:** <https://discuss.elastic.co/t/exact-difference-between-query-string-query-and-multi-match-query-with-cross-fields/16666>\
**Category:** Elasticsearch\
**Created:** [March 28, 2014, 5:50am UTC](https://discuss.elastic.co/t/exact-difference-between-query-string-query-and-multi-match-query-with-cross-fields/16666 "2014-03-28T05:50:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prashant\_Pal](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@Prashant\_Pal](https://discuss.elastic.co/u/Prashant_Pal)\
**Post date:** [March 28, 2014, 5:50am UTC](https://discuss.elastic.co/t/exact-difference-between-query-string-query-and-multi-match-query-with-cross-fields/16666/1 "2014-03-28T05:50:20Z")

</div>

Hi ES users,

While exploring the new release of ES 1.1.0 I came across with the release of cross\_fields query in multi\_match.  
So is there any difference between "Query\_string" query and "multi\_match" query with cross\_fields.

for ex:  
if my query\_string query is:  
"query\_string": {  
"fields": [  
"title",  
"content"  
],  
"query": "mobile phones"

So it will search for mobile or phones in either of title or content. like the result will come as  
**{mobile in title | mobile in content | phones in title | phones in content}**

Similarly for multi\_match query with cross\_fields:  
{  
"multi\_match" : {  
"query": "mobile phones",  
"type": "cross\_fields",  
"fields": ["title", "content"]  
}  
}

So in this also the search result will be like:  
**{mobile in title | mobile in content | phones in title | phones in content}**

So just let me know if my interpretation is wrong in any of the scenario. If not then what exactly is the difference between these two.

---

<div class="post-metadata">

**Author:** ![Prashant\_Pal](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@Prashant\_Pal](https://discuss.elastic.co/u/Prashant_Pal)\
**Post date:** [April 1, 2014, 6:43am UTC](https://discuss.elastic.co/t/exact-difference-between-query-string-query-and-multi-match-query-with-cross-fields/16666/2 "2014-04-01T06:43:31Z")

</div>

Any updates on the above query?

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood\_2](https://avatars.discourse-cdn.com/v4/letter/m/c77e96/32.png) [@Mark\_Harwood\_2](https://discuss.elastic.co/u/Mark_Harwood_2)\
**Post date:** [April 1, 2014, 8:07am UTC](https://discuss.elastic.co/t/exact-difference-between-query-string-query-and-multi-match-query-with-cross-fields/16666/3 "2014-04-01T08:07:17Z")

</div>

The first difference is that the match/multi-match query aims to avoid the  
sorts of syntax errors that can occur when using query\_string which  
supports several special characters that act as operators that must be used  
correctly or the query will fail to parse.

Given the simpler nature of the match/multi-match queries it is possible to  
apply some smarter logic to ranking how the terms match in a multi-field  
context.  
Lucene has a natural tendency to rank the rarer elements in a query more  
highly and you can probably see this effect in multi-field query\_string  
queries in the way it can favour bizarre interpretations of your search. As  
an example, if searching firstName and lastName fields the search term  
"John" will rank higher if found in the lastName field rather than the more  
commonplace firstName field due to Lucene's "IDF" (Inverse Document  
Frequency) ranking favouring the scarcity of lastName:John.  
The new multi-match algorithm will instead attempt to favour the most  
likely interpretation of each search term and so firstName:John should rank  
higher than lastName:John.

Cheers  
Mark

On Friday, March 28, 2014 5:50:21 AM UTC, Prashy wrote:

> Hi ES users,
> 
> While exploring the new release of ES 1.1.0 I came across with the release  
> of cross\_fields query in multi\_match.  
> So is there any difference between "Query\_string" query and "multi\_match"  
> query with cross\_fields.
> 
> for ex:  
> if my query\_string query is:  
> "query\_string": {  
> "fields": [  
> "title",  
> "content"  
> ],  
> "query": "mobile phones"
> 
> So it will search for mobile or phones in either of title or content. like  
> the result will come as  
> _{mobile in title | mobile in content | phones in title | phones in  
> content}_
> 
> Similarly for multi\_match query with cross\_fields:  
> {  
> "multi\_match" : {  
> "query": "mobile phones",  
> "type": "cross\_fields",  
> "fields": ["title", "content"]  
> }  
> }
> 
> So in this also the search result will be like:  
> _{mobile in title | mobile in content | phones in title | phones in  
> content}_
> 
> So just let me know if my interpretation is wrong in any of the scenario.  
> If  
> not then what exactly is the difference between these two.
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/Exact-difference-between-Query-string-query-and-multi-match-query-with-cross-fields-tp4052982.html](http://elasticsearch-users.115913.n3.nabble.com/Exact-difference-between-Query-string-query-and-multi-match-query-with-cross-fields-tp4052982.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/94c94379-2f62-49dd-97ac-b6c04765334e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/94c94379-2f62-49dd-97ac-b6c04765334e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 1:39am UTC](https://discuss.elastic.co/t/exact-difference-between-query-string-query-and-multi-match-query-with-cross-fields/16666/4 "2017-07-06T01:39:05Z")

</div>


