# Match Prefix Query doesn't return proper results

**URL:** <https://discuss.elastic.co/t/match-prefix-query-doesnt-return-proper-results/45816>\
**Category:** Elasticsearch\
**Created:** [March 30, 2016, 3:47pm UTC](https://discuss.elastic.co/t/match-prefix-query-doesnt-return-proper-results/45816 "2016-03-30T15:47:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaKro](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@MaKro](https://discuss.elastic.co/u/MaKro)\
**Post date:** [March 30, 2016, 3:47pm UTC](https://discuss.elastic.co/t/match-prefix-query-doesnt-return-proper-results/45816/1 "2016-03-30T15:47:55Z")

</div>

Hello.

I have a problem with my query which looks like that:

> ```
> `{
> "from" : 0, 
> "size" : 500, 
> "query" : { 
> "bool" : { 
> "must" : { 
> "bool" : { 
> "should" : { 
> "match" : { 
> "title" : { 
> "query" : "whirlpool c", 
> "type" : "phrase_prefix" 
> }  
> } 
> }, 
> "minimum_should_match" : "1" 
> } 
> } 
> } 
> }, 
> "sort" : [ { 
> "modified" : { 
> "order" : "desc", 
> "missing" : "_last" 
> } 
> }, 
> { 
> "_score" : { 
> "order" : "asc", 
> "missing" : "_last" 
> } 
> }] 
> }`
> 
> ```

This query is returning 0 hits. If I will search for "whirlpool ch" it's working fine. i've got few similar cases.  
I'm working on elasticsearch 1.7.

I don't know why it's not returning results for whirlpool c, for different words combination it's working fine.  
For example if I will have document with property title set to "My new title" and I will search for "new t", it's working fine.

The document which I'm looking for is called "whirlpool changes the world".  
I created different document with title "whirlpool created something new", but it also cannot be found. Of course If I will look for "whirlpool cr", then document is found.

Any ideas what can be wrong?

---

<div class="post-metadata">

**Author:** ![MaKro](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@MaKro](https://discuss.elastic.co/u/MaKro)\
**Post date:** [March 31, 2016, 7:50am UTC](https://discuss.elastic.co/t/match-prefix-query-doesnt-return-proper-results/45816/2 "2016-03-31T07:50:56Z")

</div>

I found the reason why I didn't get results.

setting the max\_expansions to a bigger value (which by default is set to 10, I think) fixed an issue.

---

<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 5, 2017, 11:03pm UTC](https://discuss.elastic.co/t/match-prefix-query-doesnt-return-proper-results/45816/3 "2017-07-05T23:03:45Z")

</div>


