# Match phrase and minimum\_should\_match combination

**URL:** <https://discuss.elastic.co/t/match-phrase-and-minimum-should-match-combination/21847>\
**Category:** Elasticsearch\
**Created:** [January 27, 2015, 11:59am UTC](https://discuss.elastic.co/t/match-phrase-and-minimum-should-match-combination/21847 "2015-01-27T11:59:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zdeseb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zdeseb/32/42106_2.png) [@zdeseb](https://discuss.elastic.co/u/zdeseb)\
**Post date:** [January 27, 2015, 11:59am UTC](https://discuss.elastic.co/t/match-phrase-and-minimum-should-match-combination/21847/1 "2015-01-27T11:59:53Z")

</div>

Hi,  
I try to use _ngram_ based solution as "shotgun approach" to get results  
which are not covered by more precise analyzers.

Article describing this approach is for example here  
[http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/ngrams-compound-words.html](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/ngrams-compound-words.html)

_Match_ query, it is working as expected including parameter  
minimum\_should\_match (this parameter is very important to be able to  
exclude matches of only one ngram from queried word).

_1._ Below is explanation of _match_ query searching word _"first"_ without

filtered(Text:fir Text:irs Text:rst)-\>cache(\_type:item)

and with "minimum\_should\_match": "80%"

filtered((Text:fir Text:irs Text:rst)_~2_)-\>cache(\_type:item)

1. But if I try to use the same with _match\_phrase_ query and phrase _"first  
second"_ I'll get the same result with or without minimum\_should\_match  
parameter

filtered(Text:"(fir irs rst) (sec eco con ond)")-\>cache(\_type:item)

I 'am expecting (for minimum\_should\_match) something like

filtered(Text:"(fir irs rst)_~2_ (sec eco con ond)_~3_")-\>cache(\_type:item)

In attached file, there is complete Marvel Sense code with example  
described above.

_Does anybody know if it is a bug or if it known limitation of used  
technology?_  
Or maybe there is another way how to achieve better phrase query results in  
combination with ngram analyzer.

Thanks,  
Zdenek

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/0c637de8-0c27-4097-a94c-88247fa012f2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0c637de8-0c27-4097-a94c-88247fa012f2%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:36am UTC](https://discuss.elastic.co/t/match-phrase-and-minimum-should-match-combination/21847/2 "2017-07-06T00:36:26Z")

</div>


