Custom facet.sort

2015-02-16 Thread Ryan Josal
Hey guys, I have a desire to order (field) facets by their order of
appearance in the search results.

When I first thought about it, I figured there would be some way to plug a
custom Comparator into FacetComponent and link it to facet.sort=rank or
something like that, but not only is there no real way to plug in a custom
sort (nor is subclassing the component feasible), the complexity is further
compounded by the fact faceting really only operates on the docset and so
scores aren't available.  If max(score) was an attribute of a facetcount
object this type of sort could be done.  sum(score) might also be
interesting for a weighted approach.  I can imagine performance concerns
with doing this though.  Operating on the doclist isn't enough because it's
only a slice of the results.  What if I reduce my scope to only needing the
top 2 facets in order?  It still seems to be just as complex because you
have to start from the first page and request an extra long docslice from
QueryComponent by hacking the start/rows params, and for all you know you
need to get to the last document to get all the facets.

So does anyone have any ideas of how to implement this?  Maybe it isn't
even through faceting.

Ryan


custom facet.sort

2013-05-07 Thread Giovanni Bricconi
I have a string field containing values such as 1khz 1ghz 1mhz etc.

I use this field to show a facet, currently I'm showing results in
facet.sort=count order. Now I'm asked to reorder the facet according to the
unit of measure (khz/mhz/ghz).

I also have 3/4 other custom sorting to implement

Is it possible to plug in a custom java class to provide custom facet.sort
modes?

Thank you

Giovanni