C# 클래스 Lucene.Net.Index.IndexWriterConfig

Holds all the configuration that is used to create an IndexWriter. Once IndexWriter has been created with this object, changes to this object will not affect the IndexWriter instance. For that, use LiveIndexWriterConfig that is returned from IndexWriter#getConfig().

All setter methods return IndexWriterConfig to allow chaining settings conveniently, for example:

 IndexWriterConfig conf = new IndexWriterConfig(analyzer); conf.setter1().setter2(); 
상속: LiveIndexWriterConfig, ICloneable
파일 보기 프로젝트 열기: paulirwin/lucene.net 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
WRITE_LOCK_TIMEOUT long

공개 메소드들

메소드 설명
Clone ( ) : object
IndexWriterConfig ( Version matchVersion, Analyzer analyzer ) : System

Creates a new config that with defaults that match the specified Version as well as the default {@link Analyzer}. If matchVersion is >= {@link Version#LUCENE_32}, TieredMergePolicy is used for merging; else LogByteSizeMergePolicy. Note that TieredMergePolicy is free to select non-contiguous merges, which means docIDs may not remain monotonic over time. If this is a problem you should switch to LogByteSizeMergePolicy or LogDocMergePolicy.

SetCodec ( System.Codec codec ) : IndexWriterConfig

Set the Codec.

Only takes effect when IndexWriter is first created.

SetFlushPolicy ( Lucene.Net.Index.FlushPolicy flushPolicy ) : IndexWriterConfig

Expert: Controls when segments are flushed to disk during indexing. The FlushPolicy initialized during IndexWriter instantiation and once initialized the given instance is bound to this IndexWriter and should not be used with another writer.

SetIndexCommit ( IndexCommit commit ) : IndexWriterConfig

Expert: allows to open a certain commit point. The default is null which opens the latest commit point.

Only takes effect when IndexWriter is first created.

SetIndexDeletionPolicy ( IndexDeletionPolicy deletionPolicy ) : IndexWriterConfig

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.

Only takes effect when IndexWriter is first created.

SetIndexerThreadPool ( Lucene.Net.Index.DocumentsWriterPerThreadPool threadPool ) : IndexWriterConfig

Expert: Sets the DocumentsWriterPerThreadPool instance used by the IndexWriter to assign thread-states to incoming indexing threads. If no DocumentsWriterPerThreadPool is set IndexWriter will use ThreadAffinityDocumentsWriterThreadPool with max number of thread-states set to #DEFAULT_MAX_THREAD_STATES (see #DEFAULT_MAX_THREAD_STATES).

NOTE: The given DocumentsWriterPerThreadPool instance must not be used with other IndexWriter instances once it has been initialized / associated with an IndexWriter.

NOTE: this only takes effect when IndexWriter is first created.

SetIndexingChain ( IndexingChain indexingChain ) : IndexWriterConfig

Expert: sets the DocConsumer chain to be used to process documents.

Only takes effect when IndexWriter is first created.

SetInfoStream ( Lucene.Net.Util.InfoStream infoStream ) : IndexWriterConfig

Information about merges, deletes and a message when maxFieldLength is reached will be printed to this. Must not be null, but InfoStream#NO_OUTPUT may be used to supress output.

SetInfoStream ( TextWriter printStream ) : IndexWriterConfig

Convenience method that uses PrintStreamInfoStream. Must not be null.

SetMaxBufferedDeleteTerms ( int maxBufferedDeleteTerms ) : IndexWriterConfig
SetMaxBufferedDocs ( int maxBufferedDocs ) : IndexWriterConfig
SetMaxThreadStates ( int maxThreadStates ) : IndexWriterConfig

Sets the max number of simultaneous threads that may be indexing documents at once in IndexWriter. Values < 1 are invalid and if passed maxThreadStates will be set to #DEFAULT_MAX_THREAD_STATES.

Only takes effect when IndexWriter is first created.

SetMergePolicy ( MergePolicy mergePolicy ) : IndexWriterConfig

Expert: MergePolicy is invoked whenever there are changes to the segments in the index. Its role is to select which merges to do, if any, and return a MergePolicy.MergeSpecification describing the merges. It also selects merges to do for forceMerge.

Only takes effect when IndexWriter is first created.

SetMergeScheduler ( Lucene.Net.Index.MergeScheduler mergeScheduler ) : IndexWriterConfig

Expert: sets the merge scheduler used by this writer. The default is ConcurrentMergeScheduler.

NOTE: the merge scheduler cannot be null.

Only takes effect when IndexWriter is first created.

SetMergedSegmentWarmer ( IndexReaderWarmer mergeSegmentWarmer ) : IndexWriterConfig
SetOpenMode ( OpenMode_e openMode ) : IndexWriterConfig

Specifies OpenMode of the index.

Only takes effect when IndexWriter is first created.

SetRAMBufferSizeMB ( double ramBufferSizeMB ) : IndexWriterConfig
SetRAMPerThreadHardLimitMB ( int perThreadHardLimitMB ) : IndexWriterConfig

Expert: Sets the maximum memory consumption per thread triggering a forced flush if exceeded. A DocumentsWriterPerThread is forcefully flushed once it exceeds this limit even if the #getRAMBufferSizeMB() has not been exceeded. this is a safety limit to prevent a DocumentsWriterPerThread from address space exhaustion due to its internal 32 bit signed integer based memory addressing. The given value must be less that 2GB (2048MB)

SetReaderPooling ( bool readerPooling ) : IndexWriterConfig

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 DirectoryReader#open(IndexWriter, boolean). 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 DirectoryReader#open(IndexWriter, boolean) is called.

Only takes effect when IndexWriter is first created.

SetReaderTermsIndexDivisor ( int divisor ) : IndexWriterConfig
SetSimilarity ( Similarity similarity ) : IndexWriterConfig

Expert: set the Similarity implementation used by this IndexWriter.

NOTE: the similarity cannot be null.

Only takes effect when IndexWriter is first created.

SetTermIndexInterval ( int interval ) : IndexWriterConfig
SetUseCompoundFile ( bool useCompoundFile ) : IndexWriterConfig
SetWriteLockTimeout ( long writeLockTimeout ) : IndexWriterConfig

Sets the maximum time to wait for a write lock (in milliseconds) for this instance. You can change the default value for all instances by calling #setDefaultWriteLockTimeout(long).

Only takes effect when IndexWriter is first created.

ToString ( ) : string

비공개 메소드들

메소드 설명
SetIndexWriter ( IndexWriter writer ) : IndexWriterConfig

Sets the IndexWriter this config is attached to.

메소드 상세

Clone() 공개 메소드

public Clone ( ) : object
리턴 object

IndexWriterConfig() 공개 메소드

Creates a new config that with defaults that match the specified Version as well as the default {@link Analyzer}. If matchVersion is >= {@link Version#LUCENE_32}, TieredMergePolicy is used for merging; else LogByteSizeMergePolicy. Note that TieredMergePolicy is free to select non-contiguous merges, which means docIDs may not remain monotonic over time. If this is a problem you should switch to LogByteSizeMergePolicy or LogDocMergePolicy.
public IndexWriterConfig ( Version matchVersion, Analyzer analyzer ) : System
matchVersion Version
analyzer Analyzer
리턴 System

SetCodec() 공개 메소드

Set the Codec.

Only takes effect when IndexWriter is first created.

public SetCodec ( System.Codec codec ) : IndexWriterConfig
codec System.Codec
리턴 IndexWriterConfig

SetFlushPolicy() 공개 메소드

Expert: Controls when segments are flushed to disk during indexing. The FlushPolicy initialized during IndexWriter instantiation and once initialized the given instance is bound to this IndexWriter and should not be used with another writer.
public SetFlushPolicy ( Lucene.Net.Index.FlushPolicy flushPolicy ) : IndexWriterConfig
flushPolicy Lucene.Net.Index.FlushPolicy
리턴 IndexWriterConfig

SetIndexCommit() 공개 메소드

Expert: allows to open a certain commit point. The default is null which opens the latest commit point.

Only takes effect when IndexWriter is first created.

public SetIndexCommit ( IndexCommit commit ) : IndexWriterConfig
commit IndexCommit
리턴 IndexWriterConfig

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.

Only takes effect when IndexWriter is first created.

public SetIndexDeletionPolicy ( IndexDeletionPolicy deletionPolicy ) : IndexWriterConfig
deletionPolicy IndexDeletionPolicy
리턴 IndexWriterConfig

SetIndexerThreadPool() 공개 메소드

Expert: Sets the DocumentsWriterPerThreadPool instance used by the IndexWriter to assign thread-states to incoming indexing threads. If no DocumentsWriterPerThreadPool is set IndexWriter will use ThreadAffinityDocumentsWriterThreadPool with max number of thread-states set to #DEFAULT_MAX_THREAD_STATES (see #DEFAULT_MAX_THREAD_STATES).

NOTE: The given DocumentsWriterPerThreadPool instance must not be used with other IndexWriter instances once it has been initialized / associated with an IndexWriter.

NOTE: this only takes effect when IndexWriter is first created.

public SetIndexerThreadPool ( Lucene.Net.Index.DocumentsWriterPerThreadPool threadPool ) : IndexWriterConfig
threadPool Lucene.Net.Index.DocumentsWriterPerThreadPool
리턴 IndexWriterConfig

SetIndexingChain() 공개 메소드

Expert: sets the DocConsumer chain to be used to process documents.

Only takes effect when IndexWriter is first created.

public SetIndexingChain ( IndexingChain indexingChain ) : IndexWriterConfig
indexingChain IndexingChain
리턴 IndexWriterConfig

SetInfoStream() 공개 메소드

Information about merges, deletes and a message when maxFieldLength is reached will be printed to this. Must not be null, but InfoStream#NO_OUTPUT may be used to supress output.
public SetInfoStream ( Lucene.Net.Util.InfoStream infoStream ) : IndexWriterConfig
infoStream Lucene.Net.Util.InfoStream
리턴 IndexWriterConfig

SetInfoStream() 공개 메소드

Convenience method that uses PrintStreamInfoStream. Must not be null.
public SetInfoStream ( TextWriter printStream ) : IndexWriterConfig
printStream System.IO.TextWriter
리턴 IndexWriterConfig

SetMaxBufferedDeleteTerms() 공개 메소드

public SetMaxBufferedDeleteTerms ( int maxBufferedDeleteTerms ) : IndexWriterConfig
maxBufferedDeleteTerms int
리턴 IndexWriterConfig

SetMaxBufferedDocs() 공개 메소드

public SetMaxBufferedDocs ( int maxBufferedDocs ) : IndexWriterConfig
maxBufferedDocs int
리턴 IndexWriterConfig

SetMaxThreadStates() 공개 메소드

Sets the max number of simultaneous threads that may be indexing documents at once in IndexWriter. Values < 1 are invalid and if passed maxThreadStates will be set to #DEFAULT_MAX_THREAD_STATES.

Only takes effect when IndexWriter is first created.

public SetMaxThreadStates ( int maxThreadStates ) : IndexWriterConfig
maxThreadStates int
리턴 IndexWriterConfig

SetMergePolicy() 공개 메소드

Expert: MergePolicy is invoked whenever there are changes to the segments in the index. Its role is to select which merges to do, if any, and return a MergePolicy.MergeSpecification describing the merges. It also selects merges to do for forceMerge.

Only takes effect when IndexWriter is first created.

public SetMergePolicy ( MergePolicy mergePolicy ) : IndexWriterConfig
mergePolicy MergePolicy
리턴 IndexWriterConfig

SetMergeScheduler() 공개 메소드

Expert: sets the merge scheduler used by this writer. The default is ConcurrentMergeScheduler.

NOTE: the merge scheduler cannot be null.

Only takes effect when IndexWriter is first created.

public SetMergeScheduler ( Lucene.Net.Index.MergeScheduler mergeScheduler ) : IndexWriterConfig
mergeScheduler Lucene.Net.Index.MergeScheduler
리턴 IndexWriterConfig

SetMergedSegmentWarmer() 공개 메소드

public SetMergedSegmentWarmer ( IndexReaderWarmer mergeSegmentWarmer ) : IndexWriterConfig
mergeSegmentWarmer IndexReaderWarmer
리턴 IndexWriterConfig

SetOpenMode() 공개 메소드

Specifies OpenMode of the index.

Only takes effect when IndexWriter is first created.

public SetOpenMode ( OpenMode_e openMode ) : IndexWriterConfig
openMode OpenMode_e
리턴 IndexWriterConfig

SetRAMBufferSizeMB() 공개 메소드

public SetRAMBufferSizeMB ( double ramBufferSizeMB ) : IndexWriterConfig
ramBufferSizeMB double
리턴 IndexWriterConfig

SetRAMPerThreadHardLimitMB() 공개 메소드

Expert: Sets the maximum memory consumption per thread triggering a forced flush if exceeded. A DocumentsWriterPerThread is forcefully flushed once it exceeds this limit even if the #getRAMBufferSizeMB() has not been exceeded. this is a safety limit to prevent a DocumentsWriterPerThread from address space exhaustion due to its internal 32 bit signed integer based memory addressing. The given value must be less that 2GB (2048MB)
public SetRAMPerThreadHardLimitMB ( int perThreadHardLimitMB ) : IndexWriterConfig
perThreadHardLimitMB int
리턴 IndexWriterConfig

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 DirectoryReader#open(IndexWriter, boolean). 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 DirectoryReader#open(IndexWriter, boolean) is called.

Only takes effect when IndexWriter is first created.

public SetReaderPooling ( bool readerPooling ) : IndexWriterConfig
readerPooling bool
리턴 IndexWriterConfig

SetReaderTermsIndexDivisor() 공개 메소드

public SetReaderTermsIndexDivisor ( int divisor ) : IndexWriterConfig
divisor int
리턴 IndexWriterConfig

SetSimilarity() 공개 메소드

Expert: set the Similarity implementation used by this IndexWriter.

NOTE: the similarity cannot be null.

Only takes effect when IndexWriter is first created.

public SetSimilarity ( Similarity similarity ) : IndexWriterConfig
similarity Similarity
리턴 IndexWriterConfig

SetTermIndexInterval() 공개 메소드

public SetTermIndexInterval ( int interval ) : IndexWriterConfig
interval int
리턴 IndexWriterConfig

SetUseCompoundFile() 공개 메소드

public SetUseCompoundFile ( bool useCompoundFile ) : IndexWriterConfig
useCompoundFile bool
리턴 IndexWriterConfig

SetWriteLockTimeout() 공개 메소드

Sets the maximum time to wait for a write lock (in milliseconds) for this instance. You can change the default value for all instances by calling #setDefaultWriteLockTimeout(long).

Only takes effect when IndexWriter is first created.

public SetWriteLockTimeout ( long writeLockTimeout ) : IndexWriterConfig
writeLockTimeout long
리턴 IndexWriterConfig

ToString() 공개 메소드

public ToString ( ) : string
리턴 string

프로퍼티 상세

WRITE_LOCK_TIMEOUT 공개적으로 정적으로 프로퍼티

Default value for the write lock timeout (1,000 ms).
public static long WRITE_LOCK_TIMEOUT
리턴 long