lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daan de Wit <d.de....@o3spaces.com>
Subject Re: update a specific document
Date Fri, 19 Jun 2009 07:56:45 GMT
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 <anshumg@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)
>
>
> --
> 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.silva@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-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message