# Has\_child query boost

**URL:** <https://discuss.elastic.co/t/has-child-query-boost/4292>\
**Category:** Elasticsearch\
**Created:** [April 26, 2011, 2:44am UTC](https://discuss.elastic.co/t/has-child-query-boost/4292 "2011-04-26T02:44:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sumzitup](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@sumzitup](https://discuss.elastic.co/u/sumzitup)\
**Post date:** [April 26, 2011, 2:44am UTC](https://discuss.elastic.co/t/has-child-query-boost/4292/1 "2011-04-26T02:44:20Z")

</div>

Is it possible to add a boost to a has\_child query? I notice that the  
documentation states that a constant\_score is automatically wrapped  
around has\_child query, the constant\_score includes a boost field but  
does not seem to inherit from the has\_child query.

What would be the best way to add a boost to the has\_child query?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [April 26, 2011, 5:42pm UTC](https://discuss.elastic.co/t/has-child-query-boost/4292/2 "2011-04-26T17:42:50Z")

</div>

You can't set it now, but I added this option: [Query DSL: Allow to set boost on has\_child query · Issue #884 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/884) (simply place boost at the query). Another option is to wrap yourself an has\_child filter with a constant\_score query, and set the boost on the constant\_score query.  
On Tuesday, April 26, 2011 at 5:44 AM, Nick Mason wrote:

> Is it possible to add a boost to a has\_child query? I notice that the  
> documentation states that a constant\_score is automatically wrapped  
> around has\_child query, the constant\_score includes a boost field but  
> does not seem to inherit from the has\_child query.
> 
> What would be the best way to add a boost to the has\_child query?

---

<div class="post-metadata">

**Author:** ![sumzitup](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@sumzitup](https://discuss.elastic.co/u/sumzitup)\
**Post date:** [April 26, 2011, 11:28pm UTC](https://discuss.elastic.co/t/has-child-query-boost/4292/3 "2011-04-26T23:28:38Z")

</div>

Thanks Shay, wrapping the constant\_score around the has\_child worked a  
treat. Originally i tried building from source to apply fix you  
added, however i kept getting a unresolved dependencies for  
org.jboss.netty#netty;3.2.4.Final: when running ./gradlew command.

Thanks again!

On Apr 27, 5:42 am, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> You can't set it now, but I added this option:[Query DSL: Allow to set boost on has\_child query · Issue #884 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/884)(simply place boost at the query). Another option is to wrap yourself an has\_child filter with a constant\_score query, and set the boost on the constant\_score query.
> 
> On Tuesday, April 26, 2011 at 5:44 AM, Nick Mason wrote:
> 
> > Is it possible to add a boost to a has\_child query? I notice that the  
> > documentation states that a constant\_score is automatically wrapped  
> > around has\_child query, the constant\_score includes a boost field but  
> > does not seem to inherit from the has\_child query.
> 
> > What would be the best way to add a boost to the has\_child query?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [April 27, 2011, 12:04pm UTC](https://discuss.elastic.co/t/has-child-query-boost/4292/4 "2011-04-27T12:04:19Z")

</div>

Great. Strange regarding netty, just cleared it from my local caches and it downloads fine.  
On Wednesday, April 27, 2011 at 2:28 AM, Nick Mason wrote:

> Thanks Shay, wrapping the constant\_score around the has\_child worked a  
> treat. Originally i tried building from source to apply fix you  
> added, however i kept getting a unresolved dependencies for  
> org.jboss.netty#netty;3.2.4.Final: when running ./gradlew command.
> 
> Thanks again!
> 
> On Apr 27, 5:42 am, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> 
> > You can't set it now, but I added this option:[Query DSL: Allow to set boost on has\_child query · Issue #884 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/884)(simply place boost at the query). Another option is to wrap yourself an has\_child filter with a constant\_score query, and set the boost on the constant\_score query.
> > 
> > On Tuesday, April 26, 2011 at 5:44 AM, Nick Mason wrote:
> > 
> > > Is it possible to add a boost to a has\_child query? I notice that the  
> > > documentation states that a constant\_score is automatically wrapped  
> > > around has\_child query, the constant\_score includes a boost field but  
> > > does not seem to inherit from the has\_child query.
> > 
> > > What would be the best way to add a boost to the has\_child query?

---

<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, 4:07am UTC](https://discuss.elastic.co/t/has-child-query-boost/4292/5 "2017-07-06T04:07:33Z")

</div>


