So what you essentially want is still being able to update a document. To update a particular field in the lucene doc, you'd need to mark that field as updated/deleted and create a new document with new field information (that somehow gets merged while searching or gets taken care of in a similar manner). This as of now is not possible, and even if you were to do it using some logical workaround, it'd be much better to take the approach of just adding another doc and deleting the current one completely (marking it deleted unless you need to optimize). So by the way, is there a reason for you wanting to do so? is it that you only index data coming from a stream and you don't have access to the original source at a later time?
-- Anshum Gupta http://ai-cafe.blogspot.com On Tue, Oct 12, 2010 at 11:35 AM, Nilesh Vijaywargiay < nilesh.vi...@gmail.com> wrote: > Hi Group, > > I understand that the process of updating a document in lucene index is to > delete the document and add it again. But I do not want to delete the > document. > > I was thinking of a approach where I can create a new index with only the > fields I want to update. And then may be I can some how merge these two > indexes. I > > I read about multiple searcher but that applies where you have two index > containing different documents. I think parallel reader might help me here > but was unable to understand clearly as I am very new to lucene. > > What do you think my approach should be? > > Nilesh >