lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: 2.4 questions
Date Mon, 15 Sep 2008 19:05:18 GMT

Cam Bazz wrote:

> Hello,
>
> I see that IndexWriter.flush() is depreciated in 2.4. What do we use?

Looks like you already found it, but the javadoc says this:

      * @deprecated please call {@link #commit()}) instead

>
> Also I used to make a:
>
>        try {
>            nodeWriter = new IndexWriter(nodeDir, true, analyzer,  
> false);
>        } catch(FileNotFoundException e) {
>            nodeWriter = new IndexWriter(nodeDir, true, analyzer,  
> true);
>        }
>
>
> it seems that the constructor for indexwriter is also depreciated.

I just fixed the javadoc to say:

    *  Use {@link  
#IndexWriter(Directory,Analyzer,boolean,MaxFieldLength)} instead.

There were two changes that affect that constructor.  First, the  
autoCommit boolean will go away in 3.0, and IndexWriter will be  
hardwired to "autoCommit=false".  You can always call commit on your  
own schedule if needed.  Second, all IndexWriter ctor's now take an  
IndexWriter.MaxFieldLength instance (you can use LIMITED or UNLIMITED,  
or make your own).  This is just making the usual maxFieldLength  
setting in IndexWriter more in-your-face so that everyone is aware  
when they make an IndexWriter that it can truncate input documents  
(since it was a trap before).

Mike

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


Mime
View raw message