From lucene-user-return-12869-apmail-jakarta-lucene-user-archive=jakarta.apache.org@jakarta.apache.org Tue Feb 01 20:25:04 2005 Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 99009 invoked from network); 1 Feb 2005 20:25:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 1 Feb 2005 20:25:04 -0000 Received: (qmail 58474 invoked by uid 500); 1 Feb 2005 20:24:59 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 58448 invoked by uid 500); 1 Feb 2005 20:24:59 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 58434 invoked by uid 99); 1 Feb 2005 20:24:59 -0000 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from omx1-ext.sgi.com (HELO omx1.americas.sgi.com) (192.48.179.11) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 01 Feb 2005 12:24:57 -0800 Received: from hastur.corp.sgi.com (hastur.corp.sgi.com [198.149.32.33]) by omx1.americas.sgi.com (8.12.10/8.12.9/linux-outbound_gateway-1.1) with ESMTP id j11KOtxT031924 for ; Tue, 1 Feb 2005 14:24:55 -0600 Received: from pinckneya.peachtree.sgi.com (pinckneya.peachtree.sgi.com [169.238.221.130]) by hastur.corp.sgi.com (8.12.9/8.12.10/SGI_generic_relay-1.2) with ESMTP id j11KOsYw98858811 for ; Tue, 1 Feb 2005 12:24:55 -0800 (PST) Received: from [169.238.222.12] (ptc-222-12-pc.peachtree.sgi.com [169.238.222.12]) by pinckneya.peachtree.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id j11KOrad22303125 for ; Tue, 1 Feb 2005 15:24:54 -0500 (EST) Message-ID: <41FFE58E.2080507@sgi.com> Date: Tue, 01 Feb 2005 15:24:46 -0500 From: Jim Lynch User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Lucene Users List Subject: How do I delete? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I've been merrily cooking along, thinking I was replacing documents when I haven't. My logic is to go through a batch of documents, get a field called "reference" which is unique build a term from it and delete it via the reader.delete() method. Then I close the reader and open a writer and reprocess the batch indexing all. Here is the delete and associated code: reader = IndexReader.open(database); Term t = new Term("reference",reference); try { reader.delete(t); } catch (Exception e) { System.out.println("Delete exception;"+e); } except it isn't working. I tried to do a commt and a doCommit, but those are both protected. I do a reader.close() after processing the batch the first time. What am I missing? I don't get an exception. Reference is definitely a valid field, 'cause I print out the value at search time and compare to the doc and they are identical. Thanks, Jim. --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org