lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: IndexWriter.updateDocument(Term, Document) not removing old Document?
Date Tue, 03 Jul 2007 20:57:21 GMT

It sounds like your problem is that your id field is analyzed and as a
result contains more then one token per document ... both the
deleteDocument and updateDocument methods that take in a Term only remove
documents that have that exact Term in them.

You need to add your documents with the "id" field as UN_TOKENIZED in the
first place, and then updateDocument and deleteDocument should work (note:
your use of "\"" in building your Term also looks suspicious, like you
expect ther Term text to be analyzed into a phrase .... it's not, it's
literal term text).

: id:"com.mycompany.myapp.FooBar 142"

: Term term = new Term("id", "\"" + doc.get("id") + "\"");


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

View raw message