lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Sitowitz <sitow...@gmail.com>
Subject Migration to Lucene 4.1
Date Tue, 29 Jan 2013 19:30:35 GMT
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
sitowitz@gmail.com
703-626-3593

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message