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 your fast answers, i will do with a specific application id in one term. -- Galaio da Silva On Fri, Jun 19, 2009 at 9:09 AM, Anshum <ansh...@gmail.com> wrote: > 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, Daan de Wit <d.de....@o3spaces.com> > wrote: > > > 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 > > > > 2009/6/19 Anshum <ansh...@gmail.com>: > > > 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#deleteDocument(int)<http://lucene.apache.org/java/2_4_1/api/org/apache/lucene/index/IndexReader.html#deleteDocument%28int%29> > < > http://lucene.apache.org/java/2_4_1/api/org/apache/lucene/index/IndexReader.html#deleteDocument%28int%29 > > > > > > > > > > > -- > > > 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 3:50 AM, João Silva <galaio.si...@gmail.com> > > wrote: > > > > > >> Hi, > > >> I want to update a specific document, > > >> but i didn't found updateDocument(Query) > > >> or updateDocument(Term[]), so to make > > >> a update, i will need to have a term with an > > >> unique id, so a retrieve a u)nique document, > > >> There's any way of access the internal document > > >> id? > > >> For example, imagine that i have the id of document > > >> to update, and i want to update(Term,Document) but passing > > >> the internal id as Term. > > >> > > >> cheers, > > >> João > > >> > > >> > > >> -- > > >> Cumprimentos, > > >> João Carlos Galaio da Silva > > >> > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > > For additional commands, e-mail: java-user-h...@lucene.apache.org > > > > > -- Cumprimentos, João Carlos Galaio da Silva