Class LiveIndexWriterConfig
Holds all the configuration used by Index
@since 4.0
Namespace: Lucene.Net.Index
Assembly: Lucene.Net.dll
Syntax
public class LiveIndexWriterConfig : object
Properties
| Improve this Doc View SourceAnalyzer
Gets the default analyzer to use for indexing documents.
Declaration
public virtual Analyzer Analyzer { get; }
Property Value
Type | Description |
---|---|
Analyzer |
CheckIntegrityAtMerge
Gets or sets if Index
Use true
to enable this safety check, which can help
reduce the risk of propagating index corruption from older segments
into new ones, at the expense of slower merging.
Declaration
public virtual bool CheckIntegrityAtMerge { get; set; }
Property Value
Type | Description |
---|---|
System. |
Codec
Returns the current Codec.
Declaration
public virtual Codec Codec { get; }
Property Value
Type | Description |
---|---|
Codec |
IndexCommit
Gets the Indexnull
which specifies to open the latest index commit point.
Declaration
public virtual IndexCommit IndexCommit { get; }
Property Value
Type | Description |
---|---|
Index |
IndexDeletionPolicy
Gets the Index
Declaration
public virtual IndexDeletionPolicy IndexDeletionPolicy { get; }
Property Value
Type | Description |
---|---|
Index |
InfoStream
Returns Info
Declaration
public virtual InfoStream InfoStream { get; }
Property Value
Type | Description |
---|---|
Info |
See Also
| Improve this Doc View SourceMaxBufferedDeleteTerms
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.
Declaration
public virtual int MaxBufferedDeleteTerms { get; set; }
Property Value
Type | Description |
---|---|
System. |
See Also
| Improve this Doc View SourceMaxBufferedDocs
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.
Declaration
public virtual int MaxBufferedDocs { get; set; }
Property Value
Type | Description |
---|---|
System. |
See Also
| Improve this Doc View SourceMaxThreadStates
Returns the max number of simultaneous threads that may be indexing
documents at once in Index
Declaration
public virtual int MaxThreadStates { get; }
Property Value
Type | Description |
---|---|
System. |
MergedSegmentWarmer
Gets or sets the merged segment warmer. See Index
Takes effect on the next merge.
Declaration
public virtual IndexWriter.IndexReaderWarmer MergedSegmentWarmer { get; set; }
Property Value
Type | Description |
---|---|
Index |
MergePolicy
Returns the current Merge
Declaration
public virtual MergePolicy MergePolicy { get; }
Property Value
Type | Description |
---|---|
Merge |
See Also
| Improve this Doc View SourceMergeScheduler
Returns the IMerge
Declaration
public virtual IMergeScheduler MergeScheduler { get; }
Property Value
Type | Description |
---|---|
IMerge |
OpenMode
Declaration
public virtual OpenMode OpenMode { get; }
Property Value
Type | Description |
---|---|
Open |
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 Index
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 Max
NOTE: It's not guaranteed that all memory resident documents are
flushed once this limit is exceeded. Depending on the configured
Lucene.
The default value is DEFAULT_RAM_BUFFER_SIZE_MB.
Takes effect immediately, but only the next time a document is added, updated or deleted.
Declaration
public virtual double RAMBufferSizeMB { get; set; }
Property Value
Type | Description |
---|---|
System. |
See Also
| Improve this Doc View SourceRAMPerThreadHardLimitMB
Returns the max amount of memory each Lucene.
Declaration
public virtual int RAMPerThreadHardLimitMB { get; }
Property Value
Type | Description |
---|---|
System. |
See Also
| Improve this Doc View SourceReaderTermsIndexDivisor
Gets or sets the termsIndexDivisor passed to any readers that Index
Takes effect immediately, but only applies to readers opened after this call
NOTE: divisor settings > 1 do not apply to all Postings
Declaration
public virtual int ReaderTermsIndexDivisor { get; set; }
Property Value
Type | Description |
---|---|
System. |
Similarity
Expert: returns the Similarity implementation used by this
Index
Declaration
public virtual Similarity Similarity { get; }
Property Value
Type | Description |
---|---|
Similarity |
TermIndexInterval
Expert: Gets or sets the interval between indexed terms. Large values cause less
memory to be used by Index
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 Indexinterval/2
terms
must be scanned for each random term access.
Takes effect immediately, but only applies to newly flushed/merged segments.
NOTE: this parameter does not apply to all Postings
public class MyLucene45Codec : Lucene45Codec
{
//customize Lucene41PostingsFormat, passing minBlockSize=50, maxBlockSize=100
private readonly PostingsFormat tweakedPostings = new Lucene41PostingsFormat(50, 100);
public override PostingsFormat GetPostingsFormatForField(string field)
{
if (field.Equals("fieldWithTonsOfTerms", StringComparison.Ordinal))
return tweakedPostings;
else
return base.GetPostingsFormatForField(field);
}
}
...
iwc.Codec = new MyLucene45Codec();
Note that other implementations may have their own parameters, or no parameters at all.
Declaration
public virtual int TermIndexInterval { get; set; }
Property Value
Type | Description |
---|---|
System. |
See Also
| Improve this Doc View SourceUseCompoundFile
Gets or sets if the Indextrue
.
Use false
for batch indexing with very large RAM buffer
settings.
Note: To control compound file usage during segment merges see
No
Declaration
public virtual bool UseCompoundFile { get; set; }
Property Value
Type | Description |
---|---|
System. |
UseReaderPooling
Returns true
if Index
Declaration
public virtual bool UseReaderPooling { get; }
Property Value
Type | Description |
---|---|
System. |
WriteLockTimeout
Returns allowed timeout when acquiring the write lock.
Declaration
public virtual long WriteLockTimeout { get; }
Property Value
Type | Description |
---|---|
System. |
See Also
Methods
| Improve this Doc View SourceToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System. |