What I'm after is to restrict the 'whole' index through a set of unique
keys.
Each unique key set is likely to have between 100 & 10000 keys and these
sets are expected to be different for most of the queries. I'm trying to see
if I can achieve a generic 'fk' (for filter key) kind of parameter so this
could be applied to 'any' RequestHandler.

To keep the filter-queries functionality (as a List<Query>), I compute a
DocSet by using my 'unique key filter docset' as a base and iteratively
'and' it with the filter-queries executed through
SolrIndexReader.getDocSet(Query, DocSet).

The other way could be creating a BooleanQuery that 'ands' TermQueries built
from the unique key set; I might still revert to that since my current code
needs a small patch in SolrIndexReader (flags in getDocList).

In SolrIndexReader , if getDocListAndSet & getDocList were to accept a
DocSet filter plus the List<Query>, I'd use those but I had to choose
whether I use a List<Query> OR a DocSet as filter. I might have missed
something, the code being quite dense: the equivalent signatures I could
manage to get are:
public DocList getDocList(Query query, DocSet filter, Sort lsort, int
offset, int len, int flags) throws IOException;
and
public DocListAndSet getDocListAndSet(Query query, DocSet filter, Sort
lsort, int offset, int len, int flags) throws IOException;

It seems to work, I dont know if it is efficient cache wise & al.



Yonik Seeley wrote:
> 
> On 6/19/07, Henrib <[EMAIL PROTECTED]> wrote:
>> Is it reasonable to implement a RequestHandler that systematically uses a
>> DocSet as a filter for the restriction queries?
> 
> How many unique keys would typically be used to construct the filter?
> 
>> I'm under the impression
>> that SolrIndexSearcher.getDocSet(Query, DocSet) would use the cache
>> properly
>> & that calling it in a loop would perform the 'and' between the
>> filters...
> 
> Yes, but I wouldn't do that for each query unless each query was
> likely to have a different id list.
> 
> There's also a getDocListAndSet that takes a List<Query> as a filter.
> 
> -Yonik
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Filtering-on-a-%27unique-key%27-set-tf3935694.html#a11198985
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to