lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cam Bazz" <camb...@gmail.com>
Subject Re: 2.4 questions
Date Mon, 15 Sep 2008 19:17:45 GMT
great!

well I never use autoCommit=true.

However the documentation states that autoCommit=true.

How do we disable this? In 2.3 I used to do a:

writer.setMaxBufferedDocs(IndexWriter.DISABLE_AUTO_FLUSH);

would that totally disable autoCommit, or will it autoCommit when the
ram usage reaches a certain criteria.

Best.

On Mon, Sep 15, 2008 at 10:05 PM, Michael McCandless
<lucene@mikemccandless.com> wrote:
>
> 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
>
>

---------------------------------------------------------------------
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