Top 10 results with faceted queries

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Top 10 results with faceted queries

Andreas Hochsteger-3
Hi,

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

I have the requirement to produce a page like this:

Category 1:
 - Link 1
 - Link 2
 - ...
 - Link 10

Category 2:
 - Link 1
 - Link 2
 - ...
 - Link 10

...

Category n:
 - Link 1
 - Link 2
 - ...
 - Link 10

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.

Any help is highly appreciated!

Thanks,
Andreas
Reply | Threaded
Open this post in threaded view
|

SV: Top 10 results with faceted queries

AE-4


Andreas Hochsteger <[hidden email]> skrev:
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.

I have also the same question. As far as I can tell reading from the list is that you have to do "pre-computed quires" in advance (I am guessing some sort of a cron job and then save them in a text file.. just guessing) due to load constrains etc.. There is some discussion on the list but I don't know the exact procedure.

If you do find out about I would appreciate an answer.

Regards



 
---------------------------------

Stava rätt! Stava lätt! Yahoo! Mails stavkontroll tar hand om tryckfelen och mycket mer! Få den på http://se.mail.yahoo.com
Reply | Threaded
Open this post in threaded view
|

Re: Top 10 results with faceted queries

Chris Hostetter-3
In reply to this post by Andreas Hochsteger-3

: 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