lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: addIndexes vs addDocument
Date Wed, 07 Jul 2004 02:46:30 GMT
Roy,

Quick example.
Index A has fields 'title' and 'contents'.
Field 'contents' is stored in A as Field.UnStored.
This means that you cannot retrieve the original content of the
'contents' field, since that value was not stored verbatim in the
index.
Therefore, you cannot create a new Document instance, pull out String
value of the 'contents' field from A, use it to create another field,
add it to the new Document instance, and add that Document to a new
index B using addDocument method.

addIndexes method does not need to pull out the original String field
values from Documents, so it will work.

Otis


--- roy-lucene-user@xemaps.com wrote:
> Otis,
> 
> Thanks for the reply.  Not sure about your comment about _store_.  Do
> you mean
> the addIndexes method would retain all fields in all documents
> regardless of
> _store_, but that individual addDocument calls would not?
> 
> Roy.
> 
> On Tue, 6 Jul 2004 08:33:52 -0700 (PDT), Otis Gospodnetic wrote
> > Roy,
> > 
> > I'm not sure about the performance difference answer, but I imagine
> our
> > instinct about this is the same.  However, note that manually
> adding
> > documents will not work if you didn't _store_ (e.g. Field.Text)
> >  fields in original indices, because you will not be able to 
> > retrieve the original field value.
> > 
> > Otis
> > 
> > --- roy-lucene-user@xemaps.com wrote:
> > > Hi guys,
> > > 
> > > I have question dealing with addIndexes.  When an addIndexes
> method
> > > is done merging indexes together, it calls optimize.  We would
> like
> > > to avoid the optimize and had though about just opening a reader
> to
> > > each index to be merged and adding them in manually with the
> > > addDocument method.
> > > 
> > > So we were wondering how efficient the addIndexes was compared to
> the
> > > addDocument?
> > > 
> > > lots'o thanx
> > > 
> > > Roy.
> > > 
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> lucene-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> lucene-user-help@jakarta.apache.org
> > > 
> > > 
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> lucene-user-help@jakarta.apache.org
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 
> 


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