Have you read the changes and migration docs that come with 4.1?  You
may also need to look at 3.[123456] javadocs to see deprecations and
alternatives for stuff that was present in 3.0 but gone in 4.1.


--
Ian.

On Tue, Jan 29, 2013 at 7:30 PM, Paul Sitowitz <sitow...@gmail.com> wrote:
> 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

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to