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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
