Conditional function score query

Hi,

I have build a query using java FunctionScoreQueryBuilder
http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/query-dsl-function-score-query.html
and was wondering if it possible to create a conditional scoring to the
field? For example if the field exists and count = 1, apply factionFunction
of 1.0f . And if the field existsa nd count = 2, then apply factionFunction
of 2.0f , etc etc.

Is this possible?

Thanks.

Jason

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/62f3b076-005c-4a8e-a447-a66015db633a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

You can check out
https://github.com/jprante/elasticsearch-functionscore-conditionalboost for
an example of how this can be done with a Java plugin.

Jörg

On Fri, Jan 9, 2015 at 11:38 AM, Jason Wee peichieh@gmail.com wrote:

Hi,

I have build a query using java FunctionScoreQueryBuilder
http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/query-dsl-function-score-query.html
and was wondering if it possible to create a conditional scoring to the
field? For example if the field exists and count = 1, apply factionFunction
of 1.0f . And if the field existsa nd count = 2, then apply factionFunction
of 2.0f , etc etc.

Is this possible?

Thanks.

Jason

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/62f3b076-005c-4a8e-a447-a66015db633a%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/62f3b076-005c-4a8e-a447-a66015db633a%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFm24Wy1FEtYGBp%3D46Psx2BOcs-EELF7zZEQ3hsRqE0dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Thanks Jörg although we are using es version 0.90.7 and the project using
es version 1.2.1. Not sure if it support.

Anyway, I achieve similar behaviour by using range filter (from 0 to less
than or equal to 1, then boost 10f for example.) and passed that
to FunctionScoreQueryBuilder.

Jason

On Saturday, January 10, 2015 at 12:14:58 AM UTC+8, Jörg Prante wrote:

You can check out
https://github.com/jprante/elasticsearch-functionscore-conditionalboost
for an example of how this can be done with a Java plugin.

Jörg

On Fri, Jan 9, 2015 at 11:38 AM, Jason Wee <peic...@gmail.com
<javascript:>> wrote:

Hi,

I have build a query using java FunctionScoreQueryBuilder
http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/query-dsl-function-score-query.html
and was wondering if it possible to create a conditional scoring to the
field? For example if the field exists and count = 1, apply factionFunction
of 1.0f . And if the field existsa nd count = 2, then apply factionFunction
of 2.0f , etc etc.

Is this possible?

Thanks.

Jason

--
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 <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/62f3b076-005c-4a8e-a447-a66015db633a%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/62f3b076-005c-4a8e-a447-a66015db633a%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/e10f7bfb-4c73-4c76-ba94-8f2dc87aa245%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.