lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Bowesman <>
Subject How to not overwrite a Document if it 'already exists'?
Date Tue, 05 May 2009 10:45:25 GMT
I'm adding Documents in batches to an index with IndexWriter.  In certain 
circumstances, I do not want to add the Document if it already exists, where 
existence is determined by field id=myId.

Is there any way to do this with IndexWriter or do I have to open a reader and 
look for the term id:XXX?  Given that opening a reader is expensive, is there 
any way to do this efficiently?

I guess what I want is

IndexWriter.addDocumentIfMissing(Term term, Document doc, Analyzer analyzer)


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

View raw message