setIndexDeletionPolicy

Expert: allows an optional IndexDeletionPolicy implementation to be
specified. You can use this to control when prior commits are deleted from
the index. The default policy is KeepOnlyLastCommitDeletionPolicy
which removes all prior commits as soon as a new commit is done (this
matches behavior before 2.2). Creating your own policy can allow you to
explicitly keep previous "point in time" commits alive in the index for
some time, to allow readers to refresh to the new commit without having the
old commit deleted out from under them. This is necessary on filesystems
like NFS that do not support "delete on last close" semantics, which
Lucene's "point in time" search normally relies on.

NOTE: the deletion policy cannot be null. If null is
passed, the deletion policy will be set to the default.

setTermIndexInterval

Expert: set the interval between indexed terms. Large values cause less
memory to be used by IndexReader, but slow random-access to terms. Small
values cause more memory to be used by an IndexReader, and speed
random-access to terms.

This parameter determines the amount of computation required per query
term, regardless of the number of documents that contain that term. In
particular, it is the maximum number of other terms that must be scanned
before a term is located and its frequency and position information may be
processed. In a large index with user-entered query terms, query processing
time is likely to be dominated not by term lookup but rather by the
processing of frequency and positional data. In a small index or when many
uncommon query terms are generated (e.g., by wildcard queries) term lookup
may become a dominant cost.

In particular, numUniqueTerms/interval terms are read into
memory by an IndexReader, and, on average, interval/2 terms
must be scanned for each random term access.

setMaxBufferedDeleteTerms

Determines the minimal number of delete terms required before the buffered
in-memory delete terms are applied and flushed. If there are documents
buffered in memory at the time, they are merged and a new segment is
created.

setRAMBufferSizeMB

Determines the amount of RAM that may be used for buffering added documents
and deletions before they are flushed to the Directory. Generally for
faster indexing performance it's best to flush by RAM usage instead of
document count and use as large a RAM buffer as you can.

When this is set, the writer will flush whenever buffered documents and
deletions use this much RAM. Pass in DISABLE_AUTO_FLUSH to prevent
triggering a flush due to RAM usage. Note that if flushing by document
count is also enabled, then the flush will be triggered by whichever comes
first.

NOTE: the account of RAM usage for pending deletions is only
approximate. Specifically, if you delete by Query, Lucene currently has no
way to measure the RAM usage of individual Queries so the accounting will
under-estimate and you should compensate by either calling commit()
periodically yourself, or by using setMaxBufferedDeleteTerms(int)
to flush by count instead of RAM usage (each buffered delete Query counts
as one).

NOTE: because IndexWriter uses ints when managing its
internal storage, the absolute maximum value for this setting is somewhat
less than 2048 MB. The precise limit depends on various factors, such as
how large your documents are, how many fields have norms, etc., so it's
best to set this value comfortably under 2048.

getRAMBufferSizeMB

setMaxBufferedDocs

Determines the minimal number of documents required before the buffered
in-memory documents are flushed as a new Segment. Large values generally
give faster indexing.

When this is set, the writer will flush every maxBufferedDocs added
documents. Pass in DISABLE_AUTO_FLUSH to prevent triggering a
flush due to number of buffered documents. Note that if flushing by RAM
usage is also enabled, then the flush will be triggered by whichever comes
first.

Disabled by default (writer flushes by RAM usage).

Takes effect immediately, but only the next time a
document is added, updated or deleted.

Throws:

IllegalArgumentException - if maxBufferedDocs is enabled but smaller than 2, or it disables
maxBufferedDocs when ramBufferSize is already disabled

setReaderPooling

By default, IndexWriter does not pool the
SegmentReaders it must open for deletions and
merging, unless a near-real-time reader has been
obtained by calling IndexWriter.getReader().
This method lets you enable pooling without getting a
near-real-time reader. NOTE: if you set this to
false, IndexWriter will still pool readers once
IndexWriter.getReader() is called.

setReaderTermsIndexDivisor

Sets the termsIndexDivisor passed to any readers that
IndexWriter opens, for example when applying deletes
or creating a near-real-time reader in IndexWriter.getReader(). If you pass -1, the terms index
won't be loaded by the readers. This is only useful in
advanced situations when you will only .next() through
all terms; attempts to seek will hit an exception.

Takes effect immediately, but only applies to
readers opened after this call