public SetRAMBufferSizeMB ( double mb ) : void | ||
mb | double | |
return | void |
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 if individual Queries so the accounting will under-estimate and you should compensate by either calling commit() periodically yourself, or by using SetMaxBufferedDeleteTerms to flush by count instead of RAM usage (each buffered delete Query counts as one).
NOTE: because IndexWriter uses int
s 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.
The default value is DEFAULT_RAM_BUFFER_SIZE_MB.
enabled but non-positive, or it disables ramBufferSize when maxBufferedDocs is already disabled
public SetRAMBufferSizeMB ( double mb ) : void | ||
mb | double | |
return | void |