Re: update a specific document

2009-06-19 Thread Daan de Wit
Oops, didn't read the OP quite well... 2009/6/19 Anshum : > Exactly, its cleaner but you wouldn't be able to delete on the basis of > Lucene Document ID. > > -- > Anshum Gupta > Naukri Labs! > http://ai-cafe.blogspot.com > > The facts expressed here belong to everybody, the opinions to me. The > d

Re: update a specific document

2009-06-19 Thread João Silva
Hi, thank you all for your answers. I already done the strategies you mencioned by delete first and update or using the internal api updateDocument(term, document). If there was a updateDocument(internalid, theNewDocument) present in the api, this clarified more the process. Thanks again, for you

Re: update a specific document

2009-06-19 Thread Anshum
Exactly, its cleaner but you wouldn't be able to delete on the basis of Lucene Document ID. -- Anshum Gupta Naukri Labs! http://ai-cafe.blogspot.com The facts expressed here belong to everybody, the opinions to me. The distinction is yours to draw On Fri, Jun 19, 2009 at 1:26 PM, Da

Re: update a specific document

2009-06-19 Thread Daan de Wit
There's also IndexWriter#updateDocument(Term, Document) now, to use that one you need to be able to uniquely identify a document using a term (probably with an application-specific id field or something). This method does also delete and readd the document, but it is a somewhat cleaner api. Daan

Re: update a specific document

2009-06-18 Thread Anshum
HI Galaio, To update a document in lucene this way, you'd have to first delete the document using indexReader's delete document and then readd the document (thereby changing the internal docId as well). You may use: http://lucene.apache.org/java/2_4_1/api/org/apache/lucene/index/IndexReader.html#de