# Issue with QueryStringQuery regular expression

**URL:** <https://discuss.elastic.co/t/issue-with-querystringquery-regular-expression/137822>\
**Category:** Elasticsearch\
**Created:** [June 28, 2018, 3:50pm UTC](https://discuss.elastic.co/t/issue-with-querystringquery-regular-expression/137822 "2018-06-28T15:50:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sss/32/31486_2.png) [@sss](https://discuss.elastic.co/u/sss)\
**Post date:** [June 28, 2018, 3:50pm UTC](https://discuss.elastic.co/t/issue-with-querystringquery-regular-expression/137822/1 "2018-06-28T15:50:49Z")

</div>

ES is upgraded to 5.6.9. the following query which used to return hits in 2.4 version doesnt return anymore.Assume that there is a field 'PlanID' whose value is "Plan1005". In 5.6.9, this works only when search string is lowercased "/plan1005/", but not with "/PLAN1005/"

{  
"from": 0,  
"size": 20,  
"query": {  
"bool": {  
"must": {  
"query\_string": {  
"query": "PlanID: /Plan1005/",  
"default\_field": "PlanID",  
"default\_operator": "and",  
"allow\_leading\_wildcard": true,  
"analyze\_wildcard": true  
}  
}  
}  
},  
"stored\_fields": "\*"  
}

---

<div class="post-metadata">

**Author:** ![sss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sss/32/31486_2.png) [@sss](https://discuss.elastic.co/u/sss)\
**Post date:** [June 28, 2018, 8:53pm UTC](https://discuss.elastic.co/t/issue-with-querystringquery-regular-expression/137822/2 "2018-06-28T20:53:42Z")

</div>

So, issue seems to be with "lowercase\_expanded\_terms" not being honoured from 5.x..

In that case, will the analyzer configured at query level analyzes the query string for a regex QueryStringQuery ? In my case, the analyzer doesnt seem to do so.

Please confirm the expected behaviour

---

<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 26, 2018, 8:53pm UTC](https://discuss.elastic.co/t/issue-with-querystringquery-regular-expression/137822/3 "2018-07-26T20:53:50Z")

</div>

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