Re: How to properly use updatedocument in lucene.

2013-02-01 Thread Ian Lea
There is no way to update without reindexing the entire document. It might be less confusing if the IndexWriter.updateDocument() methods were called maybe replaceDocument() but they're not. It would also help if lucene could reject attempts to pass a Document read from the index to these methods

Re: How to properly use updatedocument in lucene.

2013-01-31 Thread VIGNESH S
Hi Mike, Thanks for your reply.. MY Scenario is I am creating Lucene Index with Two Fields 1.Filename 2.File Contents For Example I initially added fields FileName:-say LuceneInAction.pdf which is not analysed FileContents:Content of the Book it is analysed using custom analyzer. Now what is t

Re: How to properly use updatedocument in lucene.

2013-01-31 Thread Michael McCandless
On Thu, Jan 31, 2013 at 7:56 AM, Trejkaz wrote: > On Thu, Jan 31, 2013 at 11:05 PM, Michael McCandless > wrote: >> It's confusing, but you should never try to re-index a document you >> retrieved from a searcher, because certain index-time details (eg, >> whether a field was tokenized) are not pr

Re: How to properly use updatedocument in lucene.

2013-01-31 Thread Trejkaz
On Thu, Jan 31, 2013 at 11:05 PM, Michael McCandless wrote: > It's confusing, but you should never try to re-index a document you > retrieved from a searcher, because certain index-time details (eg, > whether a field was tokenized) are not preserved in the stored > document. > > Instead, you shoul

Re: How to properly use updatedocument in lucene.

2013-01-31 Thread Michael McCandless
It's confusing, but you should never try to re-index a document you retrieved from a searcher, because certain index-time details (eg, whether a field was tokenized) are not preserved in the stored document. Instead, you should re-build the document yourself, setting the right details per-Field, a

How to properly use updatedocument in lucene.

2013-01-31 Thread VIGNESH S
Hi All, I am having a basic doubt.. I am trying to update a lucene document field with a new value.. The below is my code.. It is not giving any errors and also it is not updating the document with field. Document d = searcher.doc(docId); writer1 = new IndexWriter(csDirectory, new IndexWriterC