# Query String Query is not working as expected when searched over not\_analyzed fields

**URL:** <https://discuss.elastic.co/t/query-string-query-is-not-working-as-expected-when-searched-over-not-analyzed-fields/78542>\
**Category:** Elasticsearch\
**Created:** [March 14, 2017, 2:54pm UTC](https://discuss.elastic.co/t/query-string-query-is-not-working-as-expected-when-searched-over-not-analyzed-fields/78542 "2017-03-14T14:54:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![prasad\_kp](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@prasad\_kp](https://discuss.elastic.co/u/prasad_kp)\
**Post date:** [March 14, 2017, 2:54pm UTC](https://discuss.elastic.co/t/query-string-query-is-not-working-as-expected-when-searched-over-not-analyzed-fields/78542/1 "2017-03-14T14:54:33Z")

</div>

Hi I am using the not analyzed over the field

when i search with the below query

"query": {  
"query\_string": {  
"query": "06H121605E",  
"default\_field": "invoiceID"  
}  
}  
}  
I am getting 2 documents in results

but when I went for the wild card

"query": {  
"query\_string": {  
"query": "06H121605\*",  
"default\_field": "invoiceID"  
}  
}

its giving me hits as null

Here is my mapping for the invoiceID field

"invoiceID": {  
"type": "string",  
"index": "not\_analyzed"  
},

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 29, 2017, 8:52am UTC](https://discuss.elastic.co/t/query-string-query-is-not-working-as-expected-when-searched-over-not-analyzed-fields/78542/2 "2017-03-29T08:52:25Z")

</div>

Can you produce a full script to reproduce your problem as explained in [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21)?

Will be better to get a chance to have an answer.

---

<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 26, 2017, 8:52am UTC](https://discuss.elastic.co/t/query-string-query-is-not-working-as-expected-when-searched-over-not-analyzed-fields/78542/3 "2017-04-26T08:52:29Z")

</div>

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