# Query\_string is not returning expected result ES 5.x vs ES 7.7

**URL:** https://discuss.elastic.co/t/query-string-is-not-returning-expected-result-es-5-x-vs-es-7-7/243783
**Category:** Elasticsearch
**Created:** [August 4, 2020, 8:18pm UTC](https://discuss.elastic.co/t/query-string-is-not-returning-expected-result-es-5-x-vs-es-7-7/243783 "2020-08-04T20:18:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![pappukhode](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@pappukhode](https://discuss.elastic.co/u/pappukhode)
#### Post date: [August 4, 2020, 8:18pm UTC](https://discuss.elastic.co/t/query-string-is-not-returning-expected-result-es-5-x-vs-es-7-7/243783/1 "2020-08-04T20:18:11Z")

</div>

Hi,  
I have upgraded my elasticsearch recently from 5.5 to 7.7.  
While running my automation test suite, I found that `query_string` in ES 5.5 was returning me expected document but ES 7.7 is returning empty results.  
I noticed this issue only when I search with multiple words where term is present in different fields of a document. Please have a look on my example below:

**My indexed document is like below**  
` { field1: "Hello Nik", field2: "NYC" }`

**\_mappings:**  
`"field1" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } }`  
Same mapping is there for _field2_.

**My query snippet:**  
` "query_string": { "query": "Hello NYC", "default_operator": "AND" }`

In elasticsearch 5.5 i was getting result successfully but in 7.7 I am getting empty result.  
As per my understanding, ES will look for the search terms in all the fields as I have not provided fields section.

Could you please suggest why ES 7.7 is not returning expected result ?  
Are there any changes in search query algo?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [August 4, 2020, 9:05pm UTC](https://discuss.elastic.co/t/query-string-is-not-returning-expected-result-es-5-x-vs-es-7-7/243783/2 "2020-08-04T21:05:11Z")

</div>

The \_all field has been deprecated so the search behaviour may change. What is the mapping of the fields?

---

<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: [September 1, 2020, 9:05pm UTC](https://discuss.elastic.co/t/query-string-is-not-returning-expected-result-es-5-x-vs-es-7-7/243783/3 "2020-09-01T21:05:13Z")

</div>

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