: is it possible to do a faceted search and additionally returning the
: first 10 results for each facet (or category) in one query?

There no way to do something like this "out of the box" but if you are
familiar with java it would be fairly straight forward to write a custom
RequestHandler that does ... it could subclass StandardRequestHandler and
let "super" do the bulk of the work, inspecting the SolrQueryResponse to
add the extra info before returning.

: The naive approach would be to perform separate solr queries for each
: category, take to top 10 and aggregate the results.
: This works, but it's really slow, since there may be up to 40
: categories on one page.

this wouldn't neccessarily get much faster if it was all in a single
request handler ... the caching that is used to make facet counts fast
should help ensure that if you iteratively query for each constraint to
get the "first n" matching docs those constraints and their doc sets
should already be in the cache -- assuming you currently have
<useFilterForSortedQuery>true</useFilterForSortedQuery> in your solrconfig
(and you are requesting that the results be sorted by soemthing other then
score), that cache should already be getting used ...  you might see just
as much speed up in performance by using persistent HTTP connections (ie:
Keep-Alive) when you make hte subsequent queries as you would if you did a
bunch of work to put the logic ina RequestHandler.


-Hoss

Reply via email to