Weighted random sampling and score normalization


(Dhruv Garg) #1

Hey all,

I am using a function score to compute a score for my documents. I'd like
to now sample from these elements at in a weighted fashion. So if my
function_score returns:

d1: s = 1
d2: s = 2
d3: s = 3

I'd like to see d3 show up as the first result 50% of the time, d2 show up
as first result 33% of the time, and d3 show up as the first result 16% of
the time.

Any ideas on how to implement such a scheme? I couldn't find a built in
function to achieve this, but I may be wrong.

I think a pre-requisite to this is having the ability to normalize the
scores that come out of my function_score query. Any tips on how to do that
would also be useful.

Thanks!

--
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/a9e1b63e-4c11-4f86-a460-90879c1d844b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #2