# Boosting an or clause inside a custom score filter

**URL:** <https://discuss.elastic.co/t/boosting-an-or-clause-inside-a-custom-score-filter/12863>\
**Category:** Elasticsearch\
**Created:** [July 19, 2013, 4:54pm UTC](https://discuss.elastic.co/t/boosting-an-or-clause-inside-a-custom-score-filter/12863 "2013-07-19T16:54:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gregoire\_Boivin](https://avatars.discourse-cdn.com/v4/letter/g/f4b2a3/32.png) [@Gregoire\_Boivin](https://discuss.elastic.co/u/Gregoire_Boivin)\
**Post date:** [July 19, 2013, 4:54pm UTC](https://discuss.elastic.co/t/boosting-an-or-clause-inside-a-custom-score-filter/12863/1 "2013-07-19T16:54:12Z")

</div>

Hi all,

I am trying to implement an advanced scoring using a custom filter score as  
shown in this gist : [https://gist.github.com/gboivin/59ccd243c8259e53cb16](https://gist.github.com/gboivin/59ccd243c8259e53cb16)

But the boost attached to the clauses in the OR are not having any effect  
on the result of the query since the score for these clauses is always 1 as  
soon as they match.

Any way to apply a boost to these specific clauses or any criticism on the  
query?

Thanks in advance!

Greg

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![javanna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javanna/32/4698_2.png) [@javanna](https://discuss.elastic.co/u/javanna)\
**Post date:** [July 22, 2013, 8:05am UTC](https://discuss.elastic.co/t/boosting-an-or-clause-inside-a-custom-score-filter/12863/2 "2013-07-22T08:05:57Z")

</div>

Hi Greg,  
as you already figured out, the boost in the internal clauses is not taken  
into account. I'm not sure I understood why you don't put all those clauses  
in the top level filters part of the custom filters score query. What is  
the behaviour that you would expect there?

On Friday, July 19, 2013 6:54:12 PM UTC+2, Grégoire Boivin wrote:

> Hi all,
> 
> I am trying to implement an advanced scoring using a custom filter score  
> as shown in this gist :  
> [Boosting an or clause in a custom score filter · GitHub](https://gist.github.com/gboivin/59ccd243c8259e53cb16)
> 
> But the boost attached to the clauses in the OR are not having any effect  
> on the result of the query since the score for these clauses is always 1 as  
> soon as they match.
> 
> Any way to apply a boost to these specific clauses or any criticism on the  
> query?
> 
> Thanks in advance!
> 
> Greg

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:25am UTC](https://discuss.elastic.co/t/boosting-an-or-clause-inside-a-custom-score-filter/12863/3 "2017-07-06T02:25:16Z")

</div>


