# Different behaviour of query\_string on elasticsearch v5.6.13 and v6.4.3

**URL:** <https://discuss.elastic.co/t/different-behaviour-of-query-string-on-elasticsearch-v5-6-13-and-v6-4-3/158531>\
**Category:** Elasticsearch\
**Created:** [November 28, 2018, 9:51am UTC](https://discuss.elastic.co/t/different-behaviour-of-query-string-on-elasticsearch-v5-6-13-and-v6-4-3/158531 "2018-11-28T09:51:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pankhuri](https://avatars.discourse-cdn.com/v4/letter/p/58f4c7/32.png) [@pankhuri](https://discuss.elastic.co/u/pankhuri)\
**Post date:** [November 28, 2018, 9:51am UTC](https://discuss.elastic.co/t/different-behaviour-of-query-string-on-elasticsearch-v5-6-13-and-v6-4-3/158531/1 "2018-11-28T09:51:15Z")

</div>

Hi,

Please perform the following steps to regenerate the issue -

Create a test index with following settings on v6.4.3 and v5.6.13 (remove settings.index.max\_ngram\_diff)

PUT test  
{  
"mappings": {  
"string": {  
"properties": {  
"name": {  
"type": "text",  
"fields": {  
"raw": {  
"type": "keyword"  
}  
},  
"analyzer": "str\_index\_analyzer",  
"search\_analyzer": "str\_search\_analyzer"  
}  
}}},  
"settings": {  
"index": {  
"max\_ngram\_diff": "30",  
"number\_of\_shards": "1",  
"analysis": {  
"filter": {  
"substring": {  
"type": "nGram",  
"min\_gram": "2",  
"max\_gram": "26"  
}  
},  
"analyzer": {  
"str\_index\_analyzer": {  
"filter": [  
"lowercase",  
"substring"  
],  
"tokenizer": "standard"  
},  
"str\_search\_analyzer": {  
"filter": [  
"lowercase"  
],  
"tokenizer": "standard"  
}  
}  
},  
"number\_of\_replicas": "0"  
}  
}  
}

Sync this data set on both version indices -

PUT test/string/1  
{  
"name": "S S FASHION"  
}

PUT test/string/2  
{  
"name": "S S S S"  
}

Check results of -

GET test/\_search  
{  
"query": {  
"query\_string": {  
"query": "name:S S"  
}  
}  
}

GET test/\_search  
{  
"query": {  
"match": {  
"name": "S S"  
}  
}  
}

Why query\_string gave result set on v5.6.13 and not v6.4.3 and on v5.6.13 why match query failed then?

---

<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:** [December 26, 2018, 9:51am UTC](https://discuss.elastic.co/t/different-behaviour-of-query-string-on-elasticsearch-v5-6-13-and-v6-4-3/158531/2 "2018-12-26T09:51:20Z")

</div>

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