# Can I implement match phrase or limit the query result score?

**URL:** https://discuss.elastic.co/t/can-i-implement-match-phrase-or-limit-the-query-result-score/250069
**Category:** Elastic Search
**Tags:** elastic-app-search
**Created:** [September 27, 2020, 4:00am UTC](https://discuss.elastic.co/t/can-i-implement-match-phrase-or-limit-the-query-result-score/250069 "2020-09-27T04:00:51Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![monit\_pakubuwono](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/monit_pakubuwono/32/59107_2.png) [@monit\_pakubuwono](https://discuss.elastic.co/u/monit_pakubuwono)
#### Post date: [September 27, 2020, 4:00am UTC](https://discuss.elastic.co/t/can-i-implement-match-phrase-or-limit-the-query-result-score/250069/1 "2020-09-27T04:00:51Z")

</div>

![Screen Shot 2020-09-27 at 11.31.09](https://us1.discourse-cdn.com/elastic/original/3X/d/1/d1fab7af63b519eb0eeb460ae245fdee298dd190.png)

as you can see, from query preview from my console above, I type "masjid istiqlal" as the query and there is 2 result documents appear (in fact, I only have 2 documents in my engine), the first document score is 32.44 and the second document score is 1.34, both documents also appears if I access it through Restful API.

the first document is exactly the document that I want, but unfortunately the second document is also appear on my query result. actually I only wanna show 1 document for query "masjid istiqlal". the second document appears because there is "masjid" in some fields in the document.

so to solve this issue, I want to implement match phrase, I mean, I want to show document that has exact match phrase "Masjid Istiqlal", not only "Masjid" or "Istiqlal". how to do that ?

or I assume that I can limit the score, I mean, only show the document that has score more than 2.5. something like that so I can prevent the second document to show if I perform search through Restful API. can I do that ?

---

<div class="post-metadata">

### Author: ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)
#### Post date: [September 30, 2020, 11:17am UTC](https://discuss.elastic.co/t/can-i-implement-match-phrase-or-limit-the-query-result-score/250069/2 "2020-09-30T11:17:37Z")

</div>

Hey @monit_pakubuwono,

> so to solve this issue, I want to implement match phrase, I mean, I want to show document that has exact match phrase "Masjid Istiqlal", not only "Masjid" or "Istiqlal". how to do that ?

You could do that by surrounding the search term with quotes, which is described here as part of the Lucene Query Syntax: [Search | Elastic App Search Documentation [7.9] | Elastic](https://www.elastic.co/guide/en/app-search/7.9/search.html#search-search-queries).

That _may_ be case sensitive, in which case you may want to consider downcasing both your search term and your venue field.

> or I assume that I can limit the score, I mean, only show the document that has score more than 2.5. something like that so I can prevent the second document to show if I perform search through Restful API. can I do that ?

There is currently no way to set a minimum score.

Hope that helps, let me know if you have any further questions.

---

<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: [October 28, 2020, 11:17am UTC](https://discuss.elastic.co/t/can-i-implement-match-phrase-or-limit-the-query-result-score/250069/3 "2020-10-28T11:17:38Z")

</div>

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