You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Markus Franz <ma...@markus-franz.de> on 2007/03/18 20:10:36 UTC

Eliminate duplicates

Hello!

An excerpt from my Lucene use:

Document document = new Document();
document.add(new Field("title", item.title, Field.Store.YES, =
Field.Index.TOKENIZED));
document.add(new Field("desc", item.desc, Field.Store.YES, =
Field.Index.TOKENIZED));
writer.addDocument(document);
writer.optimize();

My problem is: I can add the same entry twice times. How can I avoid = this by checking the title? (Of course I thought of doing a search query = for the title before inserting, but isn't there a more cool way?)

Markus


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