Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 84919 invoked from network); 8 Feb 2006 23:33:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Feb 2006 23:33:25 -0000 Received: (qmail 88045 invoked by uid 500); 8 Feb 2006 23:33:09 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 88003 invoked by uid 500); 8 Feb 2006 23:33:08 -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 87980 invoked by uid 99); 8 Feb 2006 23:33:08 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Feb 2006 15:33:08 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [203.217.22.128] (HELO file1.syd.nuix.com.au) (203.217.22.128) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Feb 2006 15:33:07 -0800 Received: from [192.168.222.102] (host102.syd.nuix.com.au [192.168.222.102]) by file1.syd.nuix.com.au (Postfix) with ESMTP id 965D7B7BF7 for ; Thu, 9 Feb 2006 10:32:44 +1100 (EST) Message-ID: <43EA7F5E.5080305@nuix.com.au> Date: Thu, 09 Feb 2006 10:31:42 +1100 From: Daniel Noll Organization: NUIX Pty Limited User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: java-user@lucene.apache.org Subject: Re: Queries not derived from the text index References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N John Powers wrote: > This may be a tangent, but for my filters and searches, I construct the > query with "+" and "-" and what not.. is this not the right way to do > this? I haven't had to extend or write any special AND or OR classes, > I just write the query and search the once. Any advantage to writing > Filter subclasses? In our particular case, most of our filters have absolutely nothing to do with the contents of the text index, so they can't be done as queries (yet.) For instance, we can filter the search results based on the result of a query to a database. Lucene doesn't allow us to modify a Document after it's created, so we use a database as a workaround for this limitation. Historically we used to support user annotations by deleting and re-adding the document, but this process is too slow if the user wants to annotate multiple documents in a single pass. The only other benefit to using a Filter instead of a Query (for example using QueryFilter) is the ability to cache the results of something you're going to use a lot. For instance, you might have a UI which allows the user to filter by dates. The user might enter multiple queries in a single given date range, and using a filter here avoids performing the range query multiple times. Daniel -- Daniel Noll Nuix Australia Pty Ltd Suite 79, 89 Jones St, Ultimo NSW 2007, Australia Phone: (02) 9280 0699 Fax: (02) 9212 6902 This message is intended only for the named recipient. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this message or attachment is strictly prohibited. --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org