lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doron Cohen <DOR...@il.ibm.com>
Subject Re: updating document
Date Thu, 10 Aug 2006 08:00:30 GMT
Hi Deepan, The steps below seems correct, given that all the fields of the
original document are also stored - the javadoc for
indexReader.document(int n) (which I assume is what you are using) says: "
Returns the stored fields of the nth Document in this index." - so, only
stored fields would exist in the document returned by this call, and hence
only those stored fields would be added back to the index, after you are
updating this tmp_doc object with new fields.

Regards,
Doron

Deepan Chakravarthy <codeshepherd@gmail.com> wrote on 09/08/2006 10:44:13:

> Hi,
>  We have to update few documents in our index. We have add a additional
> field to them. We did as follows
>
> 1)read the documents of our interest using IndexReader
> 2)copy them to a temporary doc object (temp_doc)
> 3)delete the document in the index
> 4)close the IndexReader
> 5)open the IndexWriter
> 6)add a new field to (temp_doc)
> 7)add the (temp_doc) to the index using IndexWriter
> 8)close the IndexWriter
>
>
> The problem:
> 1)Those documents that we updated are not searchable now. When we
> perform search based we not find any of those documents we updated.
> (using IndexSearcher)
>
> 2)But we are still able to read the updated documents using IndexReader.
>
>
> Questions
> 1)When i want to update a document by adding a field, should i reindex
> all the fields again? will copying the existing document not help and
> adding new field not help ?
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>


---------------------------------------------------------------------
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