lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Lynch <>
Subject Re: How do I delete?
Date Wed, 02 Feb 2005 15:24:29 GMT
OK, the reference field was not parsed.  See:

          }else if(key.equals("reference") ) {
            reference = value;
            Field fReference = new Field("reference",value,true,true,false);
On another examination of my program, the delete does seem to be 
working.  At least the delete returns a value of 1 saying it deleted one 
record.  However the search still keeps finding the old record.  I am 
doing an optimize after each index batch. 

Unfortuately the old record is still there even after I delete it.  So I 
deleted it and replaced it with the date in a different format to see if 
it was really replaced.  The date field indicates I've still got the old 
data in there for some reason.  Is data cached somewhere?


Chris Hostetter wrote:

>: anywhere.  I checked the count coming back from the delete operation and
>: it is zero.  I even tried to delete another unique term with similar
>: results.
>First off, are you absolutely certain you are closing the reader?  it's
>not in the code you listed.
>Second, I'd bet $1 that when your documents were indexed, your "reference"
>field was analyzed and parsed into multiple terms.  Did you try searching
>for the Term you're trying to delete by?
>(I hear "luke" is a pretty handy tool for checking exactly which Terms are
>in your index)
>: >>Here is the delete and associated code:
>: >>
>: >>              reader =;
>: >>
>: >>              Term t = new Term("reference",reference);
>: >>              try {
>: >>                reader.delete(t);
>: >>              } catch (Exception e) {
>: >>                System.out.println("Delete exception;"+e);
>: >>              }
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message