Class LiveIndexWriterConfig
Holds all the configuration used by IndexWriter with few setters for settings that can be changed on an IndexWriter instance "live".
@since 4.0
Inheritance
Assembly: DistributedLucene.Net.dll
Syntax
public class LiveIndexWriterConfig : object
Properties
Name | Description |
---|---|
Analyzer | Gets the default analyzer to use for indexing documents. |
CheckIntegrityAtMerge | Gets or sets if IndexWriter should call CheckIntegrity() on existing segments before merging them into a new one.
Use |
Codec | Returns the current Codec. |
IndexCommit | Gets the IndexCommit as specified in
IndexCommit setter or the default,
|
IndexDeletionPolicy | Gets the IndexDeletionPolicy specified in IndexDeletionPolicy setter or the default KeepOnlyLastCommitDeletionPolicy |
InfoStream | Returns InfoStream used for debugging. |
MaxBufferedDeleteTerms | Gets or sets a value that determines the maximum number of delete-by-term operations that will be buffered before both the buffered in-memory delete terms and queries are applied and flushed. Disabled by default (writer flushes by RAM usage). NOTE: this setting won't trigger a segment flush. Takes effect immediately, but only the next time a document is added, updated or deleted. Also, if you only delete-by-query, this setting has no effect, i.e. delete queries are buffered until the next segment is flushed. |
MaxBufferedDocs | Gets or sets a value that 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. |
MaxThreadStates | Returns the max number of simultaneous threads that may be indexing documents at once in IndexWriter. |
MergedSegmentWarmer | Gets or sets the merged segment warmer. See IndexWriter.IndexReaderWarmer. Takes effect on the next merge. |
MergePolicy | Returns the current MergePolicy in use by this writer. |
MergeScheduler | Returns the IMergeScheduler that was set by MergeScheduler setter. |
OpenMode | |
RAMBufferSizeMB | Gets or sets a value that 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. The maximum RAM limit is inherently determined by the runtime's available memory. Yet, an IndexWriter session can consume a significantly larger amount of memory than the given RAM limit since this limit is just an indicator when to flush memory resident documents to the Directory. Flushes are likely happen concurrently while other threads adding documents to the writer. For application stability the available memory in the runtime should be significantly larger than the RAM buffer used for indexing. 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 setting MaxBufferedDeleteTerms to flush and apply buffered deletes by count instead of RAM usage (for each buffered delete Query a constant number of bytes is used to estimate RAM usage). Note that enabling MaxBufferedDeleteTerms will not trigger any segment flushes. NOTE: It's not guaranteed that all memory resident documents are flushed once this limit is exceeded. Depending on the configured Lucene.Net.Index.LiveIndexWriterConfig.FlushPolicy only a subset of the buffered documents are flushed and therefore only parts of the RAM buffer is released.
The default value is DEFAULT_RAM_BUFFER_SIZE_MB. Takes effect immediately, but only the next time a document is added, updated or deleted. |
RAMPerThreadHardLimitMB | Returns the max amount of memory each Lucene.Net.Index.DocumentsWriterPerThread can consume until forcefully flushed. |
ReaderTermsIndexDivisor | Gets or sets the termsIndexDivisor passed to any readers that IndexWriter opens, for example when applying deletes or creating a near-real-time reader in Open(IndexWriter, Boolean). 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 NOTE: divisor settings > 1 do not apply to all PostingsFormat implementations, including the default one in this release. It only makes sense for terms indexes that can efficiently re-sample terms at load time. |
Similarity | Expert: returns the Similarity implementation used by this IndexWriter. |
TermIndexInterval | Expert: Gets or sets 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, Takes effect immediately, but only applies to newly flushed/merged segments. NOTE: this parameter does not apply to all PostingsFormat implementations, including the default one in this release. It only makes sense for term indexes that are implemented as a fixed gap between terms. For example, Lucene41PostingsFormat implements the term index instead based upon how terms share prefixes. To configure its parameters (the minimum and maximum size for a block), you would instead use Lucene41PostingsFormat(Int32, Int32). which can also be configured on a per-field basis:
Note that other implementations may have their own parameters, or no parameters at all. |
UseCompoundFile | Gets or sets if the IndexWriter should pack newly written segments in a
compound file. Default is
Use Note: To control compound file usage during segment merges see NoCFSRatio and MaxCFSSegmentSizeMB. This setting only applies to newly created segments. |
UseReaderPooling | Returns |
WriteLockTimeout | Returns allowed timeout when acquiring the write lock. |
Methods
Name | Description |
---|---|
ToString() |