lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Swanhart <greenl...@gmail.com>
Subject Re: partial updating of lucene
Date Wed, 08 Dec 2004 22:59:21 GMT
You unstored fields were not stored in the index, only their terms
were stored.  When you get the document from the index and modify it,
those terms are lost when you add the document again.

You can either simply create a new document and populate all the
fields and add that document to the index, or you can add the unstored
fields to the document retrieved in step 1.


On Wed, 8 Dec 2004 17:53:26 -0500, Praveen Peddi
<ppeddi@contextmedia.com> wrote:
> Hi all,
> I have a question about updating the lucene document. I know that there is no API to
do that now. So this is what I am doing in order to update the document with the field "title".
> 
> 1) Get the document from lucene index
> 2) Remove a field called "title" and add the same field with a modified value
> 3) Remove the docment (based on one of our field) using Reader and then close the Reader.
> 4) Add the document that is obtained in 1 and modified in 2.
> 
> I am not sure if this is the right way of doing it but I am having problems searching
for that document after updating it. The problem is only with the un stored fields.
> 
> For example, I search as "description:boy" where description is a unstored, indexed,
tokenized field in the document. I find 1 document. Now I update the document the document's
title as descripbed above and repeat the same search "description:boy" and now I don't find
any results. I have not touched the field "description" at all. I just updated the field title.
> 
> Is this an expected behaviour? If not, is it a bug.
> 
> If I change the field description as stored, indexed and tokenized, the search works
fine before and after updating.
> 
> Praveen
> **************************************************************
> Praveen Peddi
> Sr Software Engg, Context Media, Inc.
> email:ppeddi@contextmedia.com
> Tel:  401.854.3475
> Fax:  401.861.3596
> web: http://www.contextmedia.com
> **************************************************************
> Context Media- "The Leader in Enterprise Content Integration"
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message