Hello,

I currently have the following production code which currently works with
Lucene 3.0:

this.luceneWriter = new IndexWriter( directory, analyzer, true,
MaxFieldLength.UNLIMITED );
this.fs.delete( this.finalOutput, true );
this.luceneWriter.setUseCompoundFile( true );
this.luceneWriter.setMergeFactor( job.getInt( "indexer.mergeFactor", 1000 )
);
this.luceneWriter.setMaxBufferedDocs( job.getInt( "indexer.minMergeDocs",
1000 ) );
this.luceneWriter.setMaxMergeDocs( job.getInt( "indexer.maxMergeDocs",
Integer.MAX_VALUE ) );

LuceneMergeRecordWriter.this.setStatus( "Adding indexes" );
LuceneMergeRecordWriter.this.luceneWriter.addIndexesNoOptimize(
LuceneMergeRecordWriter.this.luceneIndexes
                                        .toArray( new
Directory[LuceneMergeRecordWriter.this.luceneIndexes.size()] ) );

LuceneMergeRecordWriter.this.setStatus( "Optimizing index" );
LuceneMergeRecordWriter.this.luceneWriter.optimize()

I am in the process of upgrading to Lucene 4.1 but have run into some
unknown API issues. Can someone help to point out what the equivalent 4.1
code would look like?

Here is some of the partial 4.1 code that I have thus far:

        this.fs.delete( this.finalOutput, true );
        IndexWriterConfig iwconf = new IndexWriterConfig(Version.LUCENE_41,
analyzer);
        iwconf.setOpenMode( IndexWriterConfig.OpenMode.CREATE );
        iwconf.setMaxBufferedDocs( conf.getInt( "indexer.minMergeDocs",
1000 ) );
        ..................
        this.luceneWriter = new IndexWriter( directory, iwconf );

Thanks,

Paul

-- 
------------------------------------------
Paul Sitowitz
sitow...@gmail.com
703-626-3593

Reply via email to