On Fri, 2006-08-11 at 01:58 +1000, Jason Polites wrote: > Are your storing the contents of the fields in the index? That is, > specifying Field.Store.YES when creating the field? > > In my experience fields which are not stored are not recoverable from the > index (well.. they can be reconstructed but it's a lossy process). So when > you retrieve the document, you lose non-stored fields. >
Yes we have some important fields that are not stored in the index. Is there a way to overcome this problem? while updating document. Will i face the same problem with IndexModifier ? (Now I am using IndexReader and IndexWriter) Thanks Deepan www.codeshepherd.com > If you are searching on these fields then it would explain why you are > losing results. > > On 8/10/06, Deepan Chakravarthy <[EMAIL PROTECTED]> wrote: > > > > 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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > --------------------------------------------------------------------- > > 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]