We're making extensive use of custom scoring (implemented in Java). One of
the problems we've encountered is that we'd love to get not just the score,
but other data that result from the score function out of Elasticsearch.
For example, this could be a flag marking certain documents, or some sort
of custom score explanation, or even another "score" (if you need multiple
dimensions perhaps).
So far, I haven't found any way of doing this. Search scripts simply return
a float. There doesn't seem to be anything like a "search context" to
decorate the returned results, at least not in the way I need it.
For document flagging or similar feature , you can use script filter with
caching to achieve something close to it -
Also in ES 1.4.0 , there is support for scripted aggregation. Which can
like implement any custom aggregation logic.
Hope these might help in your use case.
We're making extensive use of custom scoring (implemented in Java). One of
the problems we've encountered is that we'd love to get not just the score,
but other data that result from the score function out of Elasticsearch.
For example, this could be a flag marking certain documents, or some sort
of custom score explanation, or even another "score" (if you need multiple
dimensions perhaps).
So far, I haven't found any way of doing this. Search scripts simply
return a float. There doesn't seem to be anything like a "search context"
to decorate the returned results, at least not in the way I need it.
thanks for the hints, but I'm not sure I understand how this would help. A
filter script would allow me to remove documents from the next phase and
thus the result set, but there seems to be no way to annotate the results,
unless I'm missing something obvious here?
What I'm really looking for is a way to get more than a float out of
scoring (or maybe filtering if that's easier, though it makes more sense in
the scoring phase for us). So far we've had to work with some rather
"creative" solutions to pack more than a single value into the score, but
those are really nasty hacks.
Klaus
On Thursday, 2 October 2014 15:39:36 UTC+2, vineeth mohan wrote:
Also in ES 1.4.0 , there is support for scripted aggregation. Which can
like implement any custom aggregation logic.
Hope these might help in your use case.
Thanks
Vineeth
On Thu, Oct 2, 2014 at 5:06 AM, Klaus Brunner <klaus....@gmail.com
<javascript:>> wrote:
We're making extensive use of custom scoring (implemented in Java). One
of the problems we've encountered is that we'd love to get not just the
score, but other data that result from the score function out of
Elasticsearch. For example, this could be a flag marking certain documents,
or some sort of custom score explanation, or even another "score" (if you
need multiple dimensions perhaps).
So far, I haven't found any way of doing this. Search scripts simply
return a float. There doesn't seem to be anything like a "search context"
to decorate the returned results, at least not in the way I need it.
You may have a look at the "script_fields" feature: it allows to return one
or more script evaluation for each hit (but you can't use the score here).
If you want to compute multiple scores for the same set of results, you can
try to execute multiple function score queries with a custom
"script_score', but I don't see a way to get multiple scores in one query.
-- Tanguy
Le vendredi 3 octobre 2014 08:50:19 UTC+2, Klaus Brunner a écrit :
Hi Vineeth,
thanks for the hints, but I'm not sure I understand how this would help. A
filter script would allow me to remove documents from the next phase and
thus the result set, but there seems to be no way to annotate the results,
unless I'm missing something obvious here?
What I'm really looking for is a way to get more than a float out of
scoring (or maybe filtering if that's easier, though it makes more sense in
the scoring phase for us). So far we've had to work with some rather
"creative" solutions to pack more than a single value into the score, but
those are really nasty hacks.
Klaus
On Thursday, 2 October 2014 15:39:36 UTC+2, vineeth mohan wrote:
Also in ES 1.4.0 , there is support for scripted aggregation. Which can
like implement any custom aggregation logic.
Hope these might help in your use case.
We're making extensive use of custom scoring (implemented in Java). One
of the problems we've encountered is that we'd love to get not just the
score, but other data that result from the score function out of
Elasticsearch. For example, this could be a flag marking certain documents,
or some sort of custom score explanation, or even another "score" (if you
need multiple dimensions perhaps).
So far, I haven't found any way of doing this. Search scripts simply
return a float. There doesn't seem to be anything like a "search context"
to decorate the returned results, at least not in the way I need it.
What i had in mind was , whenever you want to see the result with a
particular flag , apply the filter and see the result. The good thing here
is the filter result is cached and is not made again and hence you should
find closer performance.
thanks for the hints, but I'm not sure I understand how this would help. A
filter script would allow me to remove documents from the next phase and
thus the result set, but there seems to be no way to annotate the results,
unless I'm missing something obvious here?
What I'm really looking for is a way to get more than a float out of
scoring (or maybe filtering if that's easier, though it makes more sense in
the scoring phase for us). So far we've had to work with some rather
"creative" solutions to pack more than a single value into the score, but
those are really nasty hacks.
Klaus
On Thursday, 2 October 2014 15:39:36 UTC+2, vineeth mohan wrote:
Hello Klaus ,
For document flagging or similar feature , you can use script filter with
caching to achieve something close to it - http://www.elasticsearch.org/
guide/en/elasticsearch/reference/current/query-dsl-
script-filter.html#query-dsl-script-filter
Also in ES 1.4.0 , there is support for scripted aggregation. Which can
like implement any custom aggregation logic.
Hope these might help in your use case.
We're making extensive use of custom scoring (implemented in Java). One
of the problems we've encountered is that we'd love to get not just the
score, but other data that result from the score function out of
Elasticsearch. For example, this could be a flag marking certain documents,
or some sort of custom score explanation, or even another "score" (if you
need multiple dimensions perhaps).
So far, I haven't found any way of doing this. Search scripts simply
return a float. There doesn't seem to be anything like a "search context"
to decorate the returned results, at least not in the way I need it.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.