Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 17069 invoked from network); 25 Feb 2008 10:05:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Feb 2008 10:05:16 -0000 Received: (qmail 51540 invoked by uid 500); 25 Feb 2008 10:05:05 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 51148 invoked by uid 500); 25 Feb 2008 10:05:04 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 51137 invoked by uid 99); 25 Feb 2008 10:05:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Feb 2008 02:05:04 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [212.27.42.30] (HELO smtp4-g19.free.fr) (212.27.42.30) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Feb 2008 10:04:28 +0000 Received: from smtp4-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp4-g19.free.fr (Postfix) with ESMTP id 963773EA0C7 for ; Mon, 25 Feb 2008 11:04:33 +0100 (CET) Received: from [192.168.99.128] (seb44-1-88-163-78-202.fbx.proxad.net [88.163.78.202]) by smtp4-g19.free.fr (Postfix) with ESMTP id 3918B3EA133 for ; Mon, 25 Feb 2008 11:04:33 +0100 (CET) Message-ID: <47C292B0.4020305@codelutin.com> Date: Mon, 25 Feb 2008 11:04:32 +0100 From: Gabriel Landais Organization: Code Lutin User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: java-user@lucene.apache.org Subject: Re: Security filtering from external DB References: <47BE94CE.3020802@codelutin.com> In-Reply-To: <47BE94CE.3020802@codelutin.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Gabriel Landais a �crit : > How to create a Filter for a field in Collection? > First, split Collection in 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) : 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 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