Has_child query boost


(sumzitup) #1

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?


(Shay Banon) #2

You can't set it now, but I added this option: 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?


(sumzitup) #3

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 wrote:

You can't set it now, but I added this option: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?


(Shay Banon) #4

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 wrote:

You can't set it now, but I added this option: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?


(system) #5