lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Williams <>
Subject Re: IndexWriter update method
Date Sat, 18 Apr 2009 00:05:33 GMT
On Fri, Apr 17, 2009 at 7:27 PM, Newman, Billy <> wrote:
> I am looking for info on how to use the IndexWriter.update method.  A short example
of how to add a document and then later update would
> be very helpful.  I get lost because I can add a document with just the document, but
I need a document and a Term.  I am not really sure
> what a Term is since I did not use a Term to create the document nor do I see it in any
of the examples of searching/adding.

When you index the document, add an ID field that is unique.  Then
when you go to update the document the "Term" will be the ID of the
document you wish to update.  For example, you might add a URL as the
unique ID, then to update it might look something like:

writer.update(new Term("id",""), doc)


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

View raw message