lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
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") + "\"");




-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message