lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Elschot <>
Subject Re: Optimising A Security Filter
Date Mon, 20 Dec 2004 08:17:49 GMT
On Sunday 19 December 2004 23:05, Steve Skillcorn wrote:
> Hello All;
> I bought the Lucene in Action ebook, which is
> excellent and I can strongly recommend.  One question
> that has arisen from the book though is custom
> filters.
> I have the situation where the text of my docs is in
> Lucene, but the permissions are in my RDBMS.  I can
> write a filter (in fact have done so) that loops
> through the documents in the passed IndexReader and
> queries the DB to detect if the user is permissioned
> for them, setting the relevant BitSet.  My results are
> then paged (< last | next >) to a web page.
> Does the IndexReader that is passed to the “bits”
> method of the filter represent the entire index, or
> just the results that match the query?

The IndexReader represents the entire index.

> Is not worrying about filters and simply checking the
> returned Hit List before presenting a sensible
> approach?

That's is done by the methods
that take a filter argument.
> I can see the point to filters as presented in the
> Lucene in Action ISBN example, but are they a good
> approach where they could end up laboriously marking
> the entire index as True?

The filter is checked only for search results on the query
over the whole index.

The bit filters generally work well, except when you need
a lot of very sparse filters and memory is a concern.

Paul Elschot

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message