# Simple query string fails to find one word

**URL:** <https://discuss.elastic.co/t/simple-query-string-fails-to-find-one-word/128384>\
**Category:** Elasticsearch\
**Created:** [April 17, 2018, 2:38pm UTC](https://discuss.elastic.co/t/simple-query-string-fails-to-find-one-word/128384 "2018-04-17T14:38:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seeker](https://avatars.discourse-cdn.com/v4/letter/s/90ced4/32.png) [@Seeker](https://discuss.elastic.co/u/Seeker)\
**Post date:** [April 17, 2018, 2:38pm UTC](https://discuss.elastic.co/t/simple-query-string-fails-to-find-one-word/128384/1 "2018-04-17T14:38:03Z")

</div>

Hi there. We were building a search list for our job postings and ran into a weird problem.  
We've got a document with field "name" containing one word "Frezer". Type text and analyzed with custom analyzer.  
The thing is that for simple query string query

> ```
> "query": {
> "simple_query_string" : {
> "query": "fre*",
> "fields": ["name"],
> "default_operator": "and"
> }
> }
> 
> ```

we get correct result but when we change query to "freze\*" it disappears, same for "frez\*".  
"Frezer" works well.  
Our analyzer uses icu\_tokenizer and ascii-folding with preserve original.  
Uppercase and lowercase letters don't do the trick.  
Any ideas why it fails, and why exacly with those two letters?

@Edit1 : Exact same thing happens with match\_phrase\_prefix query.

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [April 17, 2018, 5:57pm UTC](https://discuss.elastic.co/t/simple-query-string-fails-to-find-one-word/128384/2 "2018-04-17T17:57:02Z")

</div>

Any chance you can post a complete reproduction with mapping and a sample document?

---

<div class="post-metadata">

**Author:** ![Seeker](https://avatars.discourse-cdn.com/v4/letter/s/90ced4/32.png) [@Seeker](https://discuss.elastic.co/u/Seeker)\
**Post date:** [April 18, 2018, 8:23am UTC](https://discuss.elastic.co/t/simple-query-string-fails-to-find-one-word/128384/3 "2018-04-18T08:23:18Z")

</div>

Hi, to whom it may concern the problem was with polish\_stem filter. It went "freir" while analyzing "frezer". We decided to add keyword\_repeat and unique\_stem and it now works better.

Still we are having some problems with words like "Dekarz" which can be misspelled with "Dekaż". Any suggestions how we can deal with such situation?

---

<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:** [May 16, 2018, 8:23am UTC](https://discuss.elastic.co/t/simple-query-string-fails-to-find-one-word/128384/4 "2018-05-16T08:23:35Z")

</div>

Closed on May 16, 2018, 8:23am UTC

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