lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: Eliminate duplicates
Date Sun, 18 Mar 2007 20:53:46 GMT
Markus,
What you were thinking is fine - search and, if found, delete first, then add.  Lucene allows
duplicate and offers no automated way for avoiding them.

Otis
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Simpy -- http://www.simpy.com/  -  Tag  -  Search  -  Share

----- Original Message ----
From: Markus Franz <mail@markus-franz.de>
To: java-user@lucene.apache.org
Sent: Sunday, March 18, 2007 3:10:36 PM
Subject: 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





---------------------------------------------------------------------
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