lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepan Chakravarthy <codesheph...@gmail.com>
Subject Re: updating document
Date Thu, 10 Aug 2006 01:01:13 GMT
On Thu, 2006-08-10 at 09:16 -0400, Erick Erickson wrote:
> You say "Those documents that we updated are not searchable now". I've got
> to ask the obvious question, did you close and re-open the *searcher*
> (really, the indexreader you use in your searcher)? I suspect you have, but
> thought I'd ask explicitly.
> 
> I'd also get a copy of Luke (http://www.getopt.org/luke/) and inspect my
> index after you drop/re-add the data.
I have Luke. When i inspect the index with luke i find the same result,
i.e the updated documents are not searchable in the new index. 

I guess Index Modifier used Index reader and writer internally. I am
adding more fields to existing documents in index. so some of my
documents will have n fields and other n+m fields after updating. Does
the difference in number of fields affect search in any manner ? 


> 
> Actually, have you thought about IndexModifier (I'm using Lucene 2.0). From
> the javadoc....
> 
> <<< A class to modify an index, i.e. to delete and add documents. This class
> hides IndexReader<file:///C:/lucene-2.0.0/docs/api/org/apache/lucene/index/IndexReader.html>and
> IndexWriter<file:///C:/lucene-2.0.0/docs/api/org/apache/lucene/index/IndexWriter.html>so
> that you do not need to care about implementation details such as that
> adding documents is done via IndexWriter and deletion is done via
> IndexReader.>>>
> 
> Best
> Erick
> 
> On 8/9/06, Deepan Chakravarthy <codeshepherd@gmail.com> wrote:
> >
> > 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