lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: release & migration plan
Date Thu, 15 Jul 2004 21:06:19 GMT
fp235-5 wrote:
> I am looking at the code to implement setIndexInterval() in IndexWriter. I'd
> like to have your opinion on the best way to do it.
> 
> Currently the creation of an instance of TermInfosWriter requires the following
> steps:
> ...
> IndexWriter.addDocument(Document)
> IndexWriter.addDocument(Document, Analyser)
> DocumentWriter.addDocument(String, Document)
> DocumentWriter.writePostings(Posting[],String)
> TermInfosWriter.<init>
> 
> To give a different value to indexInterval in TermInfosWriter, we need to add a
> variable holding this value into IndexWriter and DocumentWriter and modify the
> constructors for DocumentWriter and TermInfosWriter. (quite heavy changes)

I think this is the best approach.  I would replace other parameters in 
these constructors which can be derived from an IndexWriter with the 
IndexWriter.  That way, if we add more parameters like this, they can 
also be passed in through the IndexWriter.

All of the parameters to the DocumentWriter constructor are fields of 
IndexWriter.  So one can instead simply pass a single parameter, an 
IndexWriter, then access its directory, analyzer, similarity and 
maxFieldLength in the DocumentWriter constructor.  A public 
getDirectory() method would also need to be added to IndexWriter for 
this to work.

Similarly, two of SegmentMerger's constructor parameters could be 
replaced with an IndexWriter, the directory and boolean useCompoundFile.

In SegmentMerge I would replace the directory parameter with IndexWriter.

Doug

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