Sort based on statistical facet values

Hi,

I try to implement a "most popular"-item sort, where I want to use
statistical information about my ES-documents. I have looked into the
statistical facet, but I'm not able to use its values in my sort. I'm
trying to do this as a single query. I have got it to work by first get the
statistical facet, and then do the query with the custom sort function. Is
it possible to do this in one request? I'm using the Java API.

best regards,

Bjørn Bråthen

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Bjørn

No it isn't possible to do this in one query. Facets are calculated AFTER
the search request is performed, so the two-phase query you're already
using is the way to go

clint

On 18 October 2013 13:28, Bjørn Bråthen bjorbrat88@gmail.com wrote:

Hi,

I try to implement a "most popular"-item sort, where I want to use
statistical information about my ES-documents. I have looked into the
statistical facet, but I'm not able to use its values in my sort. I'm
trying to do this as a single query. I have got it to work by first get the
statistical facet, and then do the query with the custom sort function. Is
it possible to do this in one request? I'm using the Java API.

best regards,

Bjørn Bråthen

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.