You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Britske <gb...@gmail.com> on 2008/04/16 14:56:15 UTC
reusing docset to limit new query
I'm creating a custom handler where I have a base query and a resulting
doclistandset.
I need to do some extra queries to get top-results per facet. There are 2
cases:
1. the sorting used for the top-results for a particular facet is the same
as the sorting used for the already returned doclistandset. This means that
I can return a docslice of the doclist (contained in the doclistandset)
after doing some intersections. This is quick and works well.
2. The sorting is different. In this case I need to do the query again (I
think, please let me know if there's a better option), by using
SolrIndexSearcher.getDocList(...).
I'm looking for a way to tell the SolrIndexSearcher that it can limit it's
query (including sorting) to the docset that I got by 1. (orginal docset +
some intersections), because I figured it must be quicker (is it? )
I've found a method SolrIndexSearcher.cacheDocSet(..) but am not entirely
sure what it does (sideeffects? )
Can someone please elaborate on this?
Britske
--
View this message in context: http://www.nabble.com/reusing-docset-to-limit-new-query-tp16721670p16721670.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: reusing docset to limit new query
Posted by Chris Hostetter <ho...@fucit.org>.
: 2. The sorting is different. In this case I need to do the query again (I
: think, please let me know if there's a better option), by using
: SolrIndexSearcher.getDocList(...).
:
: I'm looking for a way to tell the SolrIndexSearcher that it can limit it's
: query (including sorting) to the docset that I got by 1. (orginal docset +
: some intersections), because I figured it must be quicker (is it? )
:
Just pass your DocSet (orginal docset + some intersections) to your call
to getDocList() (there are multiple arg signatures for getDocList(), take
a look at all of them)
: I've found a method SolrIndexSearcher.cacheDocSet(..) but am not entirely
: sure what it does (sideeffects? )
: Can someone please elaborate on this?
The javadocs for cacheDocSet are prety explicit ... it allows you to
ensure that the DocSet resulting from a Query gets put in the
filterCache. optionalAnswer allows you to save some time in the event
that you already know the result from an earlier (uncached) operation.
99/100 you'll just use getDocSet(Query) instead.
-Hoss