Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 3163 invoked from network); 19 Aug 2007 04:01:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Aug 2007 04:01:40 -0000 Received: (qmail 4075 invoked by uid 500); 19 Aug 2007 04:01:32 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 4043 invoked by uid 500); 19 Aug 2007 04:01:32 -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 4032 invoked by uid 99); 19 Aug 2007 04:01:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Aug 2007 21:01:32 -0700 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=SPF_NEUTRAL,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [169.229.70.150] (HELO rescomp.berkeley.edu) (169.229.70.150) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Aug 2007 04:01:54 +0000 Received: by rescomp.berkeley.edu (Postfix, from userid 1007) id D9A8E95A05; Sat, 18 Aug 2007 21:01:04 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by rescomp.berkeley.edu (Postfix) with ESMTP id CDB6C23704 for ; Sat, 18 Aug 2007 21:01:04 -0700 (PDT) Date: Sat, 18 Aug 2007 21:01:04 -0700 (PDT) From: Chris Hostetter To: java-user@lucene.apache.org Subject: Re: Deleting the result from a query or a filter and not a documents specified by Term In-Reply-To: <4479cfa0708172339u73c1dbf5ya2ac0b6f6961d9d3@mail.gmail.com> Message-ID: References: <4479cfa0708172339u73c1dbf5ya2ac0b6f6961d9d3@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org : Is there a way to delete the results from a query or a filter and not : documents specified by Term. I have seen some explanations here but i do not : know how to do it: : : http://www.nabble.com/Batch-deletions-of-Records-from-index-tf615674.html#a1644740 the simplest approach that will work in a general case: 1) build you query object 2) call rewrite on your query 3) call extractTerms on the rewritten query 4) iterate over all those terms and delete. if you have Filter it's even easier... 1) call the bits method on your filter 2) iterate over each bit and call the delete method that takes a docid. -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org