First solution is not possible (I can't create a new document) since I only have modified fields.
When I get a document, doesn't the fields have indexed terms along with it? Is there no way to get a full document (along with indexed terms) and clone it and add it to the index?
Well is there anyway I ca update a document with just one field (because I only have data for that one field)?
Praveen
----- Original Message ----- From: "Justin Swanhart" <[EMAIL PROTECTED]>
To: "Lucene Users List" <[EMAIL PROTECTED]>
Sent: Wednesday, December 08, 2004 5:59 PM
Subject: Re: partial updating of lucene
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 <[EMAIL PROTECTED]> 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:[EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
