# Prevent 'match\_phrase' from evaluating score

**URL:** https://discuss.elastic.co/t/prevent-match-phrase-from-evaluating-score/18854
**Category:** Elasticsearch
**Created:** [July 24, 2014, 4:35am UTC](https://discuss.elastic.co/t/prevent-match-phrase-from-evaluating-score/18854 "2014-07-24T04:35:39Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![11153](https://avatars.discourse-cdn.com/v4/letter/1/e274bd/32.png) [@11153](https://discuss.elastic.co/u/11153)
#### Post date: [July 24, 2014, 4:35am UTC](https://discuss.elastic.co/t/prevent-match-phrase-from-evaluating-score/18854/1 "2014-07-24T04:35:39Z")

</div>

Hello,

Is it possible to have a 'match\_phrase' query which does not do any scoring  
during search?

I know that using 'query filter' or wraps a query in 'constant\_score query'  
return documents with constant score. But as I know, what they do is  
cutting of the evaluated score, i.e. the score corresponds to the  
'match\_phrase' query is still evaluated.

In our application, we only care whether a phrase exists in a document, we  
don't care the score of each document. To have the best performance, we  
would like to eliminate the whole score evaluating process during  
'match\_phrase' query.

Is there any query type or configuration to achieve this?

Thank you.

--  
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/3a322287-101c-4f2e-bf9d-3393fb0708c0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3a322287-101c-4f2e-bf9d-3393fb0708c0%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![11153](https://avatars.discourse-cdn.com/v4/letter/1/e274bd/32.png) [@11153](https://discuss.elastic.co/u/11153)
#### Post date: [July 24, 2014, 4:37am UTC](https://discuss.elastic.co/t/prevent-match-phrase-from-evaluating-score/18854/2 "2014-07-24T04:37:03Z")

</div>

In fact, not only 'match\_phrase', we want to eliminate scoring of all  
queries.

--  
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/06018609-0ae8-42c2-835b-01d4b68e3a15%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/06018609-0ae8-42c2-835b-01d4b68e3a15%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)
#### Post date: [July 24, 2014, 5:03pm UTC](https://discuss.elastic.co/t/prevent-match-phrase-from-evaluating-score/18854/3 "2014-07-24T17:03:38Z")

</div>

I am not sure if there is a cleaner way to bypassing score, but if you  
explicitly sort against another value that is not the score, then by  
default scoring will not occur.

Perhaps if you trace the code for sort, you can find a setting that  
disables scoring in general.

--  
Ivan

On Wed, Jul 23, 2014 at 9:37 PM, 陳智清 [walker0902@gmail.com](mailto:walker0902@gmail.com) wrote:

> In fact, not only 'match\_phrase', we want to eliminate scoring of all  
> queries.
> 
> --  
> 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/06018609-0ae8-42c2-835b-01d4b68e3a15%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/06018609-0ae8-42c2-835b-01d4b68e3a15%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/06018609-0ae8-42c2-835b-01d4b68e3a15%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/06018609-0ae8-42c2-835b-01d4b68e3a15%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CALY%3DcQAYCm9jw%3DD57%2BvXg7nBRLEoGhf%2BfVNa6daH9UMJjEGQGA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAYCm9jw%3DD57%2BvXg7nBRLEoGhf%2BfVNa6daH9UMJjEGQGA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![11153](https://avatars.discourse-cdn.com/v4/letter/1/e274bd/32.png) [@11153](https://discuss.elastic.co/u/11153)
#### Post date: [July 25, 2014, 5:59am UTC](https://discuss.elastic.co/t/prevent-match-phrase-from-evaluating-score/18854/4 "2014-07-25T05:59:00Z")

</div>

The only solution I could come out is also to modify the source code. I  
just think it would be nice if there is a existing flag or configuration to  
completely skip the score evaluation process.

Thank you, Ivan!

Ivan Brusic於 2014年7月25日星期五UTC+8上午1時03分53秒寫道：

> I am not sure if there is a cleaner way to bypassing score, but if you  
> explicitly sort against another value that is not the score, then by  
> default scoring will not occur.
> 
> Perhaps if you trace the code for sort, you can find a setting that  
> disables scoring in general.
> 
> --  
> Ivan
> 
> On Wed, Jul 23, 2014 at 9:37 PM, 陳智清 \<[walke...@gmail.com](mailto:walke...@gmail.com) \<javascript:\>\>  
> wrote:
> 
> > In fact, not only 'match\_phrase', we want to eliminate scoring of all  
> > queries.
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/06018609-0ae8-42c2-835b-01d4b68e3a15%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/06018609-0ae8-42c2-835b-01d4b68e3a15%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/06018609-0ae8-42c2-835b-01d4b68e3a15%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/06018609-0ae8-42c2-835b-01d4b68e3a15%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/b2c78c85-4e72-4e88-8680-332a304c3488%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b2c78c85-4e72-4e88-8680-332a304c3488%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)
#### Post date: [July 25, 2014, 11:30pm UTC](https://discuss.elastic.co/t/prevent-match-phrase-from-evaluating-score/18854/5 "2014-07-25T23:30:02Z")

</div>

Since scoring is not important, can't you simply sort against one of the  
fields?

--  
Ivan

On Thu, Jul 24, 2014 at 10:59 PM, 陳智清 [walker0902@gmail.com](mailto:walker0902@gmail.com) wrote:

> The only solution I could come out is also to modify the source code. I  
> just think it would be nice if there is a existing flag or configuration to  
> completely skip the score evaluation process.
> 
> Thank you, Ivan!
> 
> Ivan Brusic於 2014年7月25日星期五UTC+8上午1時03分53秒寫道：
> 
> > I am not sure if there is a cleaner way to bypassing score, but if you  
> > explicitly sort against another value that is not the score, then by  
> > default scoring will not occur.
> > 
> > Perhaps if you trace the code for sort, you can find a setting that  
> > disables scoring in general.
> > 
> > --  
> > Ivan
> > 
> > On Wed, Jul 23, 2014 at 9:37 PM, 陳智清 [walke...@gmail.com](mailto:walke...@gmail.com) wrote:
> > 
> > > In fact, not only 'match\_phrase', we want to eliminate scoring of all  
> > > queries.
> > > 
> > > --  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/06018609-0ae8-42c2-835b-01d4b68e3a15%  
> > > [40googlegroups.com](http://40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/06018609-0ae8-42c2-835b-01d4b68e3a15%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/06018609-0ae8-42c2-835b-01d4b68e3a15%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .
> > > 
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > 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/b2c78c85-4e72-4e88-8680-332a304c3488%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b2c78c85-4e72-4e88-8680-332a304c3488%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/b2c78c85-4e72-4e88-8680-332a304c3488%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b2c78c85-4e72-4e88-8680-332a304c3488%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CALY%3DcQD8Cdi7tfuSFyYpSejCgzKGnsq-avEHNt6g90DjZgpK0Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQD8Cdi7tfuSFyYpSejCgzKGnsq-avEHNt6g90DjZgpK0Q%40mail.gmail.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, 1:13am UTC](https://discuss.elastic.co/t/prevent-match-phrase-from-evaluating-score/18854/6 "2017-07-06T01:13:00Z")

</div>


