lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gabriel Landais <land...@codelutin.com>
Subject Re: Security filtering from external DB
Date Mon, 25 Feb 2008 10:04:32 GMT
Gabriel Landais a écrit :
> How to create a Filter for a field in Collection<String>?
> First, split Collection in Collection<Collection> with 
> BooleanQuery.maxClauseCount items maximum in each collection.
> For each collection :
>  create a BooleanQuery with a TermQuery for each String.
>  perform a search with a HitCollector filling a BitSet
> Now we have BitSet of each Collection, perform a BitSet.or to get a 
> final BitSet
> Build a Filter based on that BitSet, and use that Filter as parameter 
> of each search
>
It works perfectly. It is implemented in a GPL project, aka 
"simexplorer-is", in class LuceneDatabase (createFilter) :
<https://labs.libre-entreprise.org/plugins/scmsvn/viewcvs.php/trunk/simexplorer-is/simexplorer-is-storage/src/java/fr/cemagref/simexplorer/is/storage/database/lucene/?root=simexplorer-si>
I think that this class is a good sample of what is possible to do with 
Lucene as a metadata database.
Hope it will help.
Regards,

-- 
Gabriel <landais@codelutin.com>
http://www.codelutin.com
tel : 02 40 50 29 28 / fax : 09 59 92 29 28


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message