lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu ...@AI.SRI.COM>
Subject Reuse single document and fields
Date Fri, 01 Feb 2008 06:41:22 GMT
Hi,

I am trying to use the latest 2.3 API on  Field to improve the indexing 
performance by reusing Documents and  Fields. 
After reading lucene-java wiki and the java doc on Field, I have a 
couple of questions about the comment in Field.setValue(), namely,
"Note that you should only use this method after the Field has been 
consumed (ie, the Document  containing this Field has been added to the 
index)":

1. Does "consumed" here  include IndexWriter.deleteDocument(...) and 
IndexWriter.updateDocument(...)?

2.  Why does it require that the  Field has been consumed first before 
it can be modified? For example, I may pre-allocate in a constructor  a 
Document and related fields with some default values but do not (or 
cannot) add the document. Before I add my first document, I need to set 
the fields with valid values.
It looks like the new Lucene core would null some of the fields if I do 
so.  I do not understand the logic behind the requirement.

I wonder if any expert can elaborate this new API in more details here?

Thanks!

Jay  

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