/// <summary>
 /// Creates a new config that that handles the live <see cref="IndexWriter"/>
 /// settings.
 /// </summary>
 internal LiveIndexWriterConfig(IndexWriterConfig config)
 {
     maxBufferedDeleteTerms  = config.MaxBufferedDeleteTerms;
     maxBufferedDocs         = config.MaxBufferedDocs;
     mergedSegmentWarmer     = config.MergedSegmentWarmer;
     ramBufferSizeMB         = config.RAMBufferSizeMB;
     readerTermsIndexDivisor = config.ReaderTermsIndexDivisor;
     termIndexInterval       = config.TermIndexInterval;
     matchVersion            = config.matchVersion;
     analyzer              = config.Analyzer;
     delPolicy             = config.IndexDeletionPolicy;
     commit                = config.IndexCommit;
     openMode              = config.OpenMode;
     similarity            = config.Similarity;
     mergeScheduler        = config.MergeScheduler;
     writeLockTimeout      = config.WriteLockTimeout;
     indexingChain         = config.IndexingChain;
     codec                 = config.Codec;
     infoStream            = config.InfoStream;
     mergePolicy           = config.MergePolicy;
     indexerThreadPool     = config.IndexerThreadPool;
     readerPooling         = config.UseReaderPooling;
     flushPolicy           = config.FlushPolicy;
     perThreadHardLimitMB  = config.RAMPerThreadHardLimitMB;
     useCompoundFile       = config.UseCompoundFile;
     checkIntegrityAtMerge = config.CheckIntegrityAtMerge;
 }
        // used by IndexWriterConfig
        internal LiveIndexWriterConfig(Analyzer analyzer, LuceneVersion matchVersion)
        {
            this.analyzer           = analyzer;
            this.matchVersion       = matchVersion;
            ramBufferSizeMB         = IndexWriterConfig.DEFAULT_RAM_BUFFER_SIZE_MB;
            maxBufferedDocs         = IndexWriterConfig.DEFAULT_MAX_BUFFERED_DOCS;
            maxBufferedDeleteTerms  = IndexWriterConfig.DEFAULT_MAX_BUFFERED_DELETE_TERMS;
            readerTermsIndexDivisor = IndexWriterConfig.DEFAULT_READER_TERMS_INDEX_DIVISOR;
            mergedSegmentWarmer     = null;
            termIndexInterval       = IndexWriterConfig.DEFAULT_TERM_INDEX_INTERVAL; // TODO: this should be private to the codec, not settable here
            delPolicy       = new KeepOnlyLastCommitDeletionPolicy();
            commit          = null;
            useCompoundFile = IndexWriterConfig.DEFAULT_USE_COMPOUND_FILE_SYSTEM;
            openMode        = Index.OpenMode.CREATE_OR_APPEND;
            similarity      = IndexSearcher.DefaultSimilarity;
#if !FEATURE_CONCURRENTMERGESCHEDULER
            mergeScheduler = new TaskMergeScheduler();
#else
            mergeScheduler = new ConcurrentMergeScheduler();
#endif
            writeLockTimeout = IndexWriterConfig.WRITE_LOCK_TIMEOUT;
            indexingChain    = DocumentsWriterPerThread.DefaultIndexingChain;
            codec            = Codec.Default;
            if (codec == null)
            {
                throw new NullReferenceException();
            }
            infoStream           = Util.InfoStream.Default;
            mergePolicy          = new TieredMergePolicy();
            flushPolicy          = new FlushByRamOrCountsPolicy();
            readerPooling        = IndexWriterConfig.DEFAULT_READER_POOLING;
            indexerThreadPool    = new DocumentsWriterPerThreadPool(IndexWriterConfig.DEFAULT_MAX_THREAD_STATES);
            perThreadHardLimitMB = IndexWriterConfig.DEFAULT_RAM_PER_THREAD_HARD_LIMIT_MB;
        }
示例#3
0
 public IndexWriterConfig SetMergedSegmentWarmer(IndexReaderWarmer mergeSegmentWarmer)
 {
     return (IndexWriterConfig)base.SetMergedSegmentWarmer(mergeSegmentWarmer);
 }
示例#4
0
		/// <summary>Set the merged segment warmer.  See {@link
		/// IndexReaderWarmer}. 
		/// </summary>
		public virtual void  SetMergedSegmentWarmer(IndexReaderWarmer warmer)
		{
			mergedSegmentWarmer = warmer;
		}
示例#5
0
 public IndexWriterConfig SetMergedSegmentWarmer(IndexReaderWarmer mergeSegmentWarmer)
 {
     return((IndexWriterConfig)base.SetMergedSegmentWarmer(mergeSegmentWarmer));
 }
 /// <summary>
 /// Set the merged segment warmer. See <seealso cref="IndexReaderWarmer"/>.
 ///
 /// <p>
 /// Takes effect on the next merge.
 /// </summary>
 public virtual LiveIndexWriterConfig SetMergedSegmentWarmer(IndexReaderWarmer mergeSegmentWarmer)
 {
     this.mergedSegmentWarmer = mergeSegmentWarmer;
     return(this);
 }
 /// <summary>
 /// Set the merged segment warmer. See <seealso cref="IndexReaderWarmer"/>.
 ///
 /// <p>
 /// Takes effect on the next merge.
 /// </summary>
 public virtual LiveIndexWriterConfig SetMergedSegmentWarmer(IndexReaderWarmer mergeSegmentWarmer)
 {
     this.mergedSegmentWarmer = mergeSegmentWarmer;
     return this;
 }
 /// <summary>
 /// Creates a new config that that handles the live <seealso cref="IndexWriter"/>
 /// settings.
 /// </summary>
 internal LiveIndexWriterConfig(IndexWriterConfig config)
 {
     maxBufferedDeleteTerms = config.MaxBufferedDeleteTerms;
     maxBufferedDocs = config.MaxBufferedDocs;
     mergedSegmentWarmer = config.MergedSegmentWarmer;
     RamBufferSizeMB = config.RAMBufferSizeMB;
     readerTermsIndexDivisor = config.ReaderTermsIndexDivisor;
     termIndexInterval = config.TermIndexInterval;
     MatchVersion = config.MatchVersion;
     analyzer = config.Analyzer;
     delPolicy = config.DelPolicy;
     Commit = config.IndexCommit;
     openMode = config.OpenMode;
     similarity = config.Similarity;
     mergeScheduler = config.MergeScheduler;
     writeLockTimeout = config.WriteLockTimeout;
     indexingChain = config.IndexingChain;
     codec = config.Codec;
     infoStream = config.InfoStream;
     mergePolicy = config.MergePolicy;
     indexerThreadPool = config.IndexerThreadPool;
     readerPooling = config.ReaderPooling;
     flushPolicy = config.FlushPolicy;
     PerThreadHardLimitMB = config.RAMPerThreadHardLimitMB;
     useCompoundFile = config.UseCompoundFile;
     checkIntegrityAtMerge = config.CheckIntegrityAtMerge;
 }
 // used by IndexWriterConfig
 internal LiveIndexWriterConfig(Analyzer analyzer, Version matchVersion)
 {
     this.analyzer = analyzer;
     this.MatchVersion = matchVersion;
     RamBufferSizeMB = IndexWriterConfig.DEFAULT_RAM_BUFFER_SIZE_MB;
     maxBufferedDocs = IndexWriterConfig.DEFAULT_MAX_BUFFERED_DOCS;
     maxBufferedDeleteTerms = IndexWriterConfig.DEFAULT_MAX_BUFFERED_DELETE_TERMS;
     readerTermsIndexDivisor = IndexWriterConfig.DEFAULT_READER_TERMS_INDEX_DIVISOR;
     mergedSegmentWarmer = null;
     termIndexInterval = IndexWriterConfig.DEFAULT_TERM_INDEX_INTERVAL; // TODO: this should be private to the codec, not settable here
     delPolicy = new KeepOnlyLastCommitDeletionPolicy();
     Commit = null;
     useCompoundFile = IndexWriterConfig.DEFAULT_USE_COMPOUND_FILE_SYSTEM;
     openMode = OpenMode_e.CREATE_OR_APPEND;
     similarity = IndexSearcher.DefaultSimilarity;
     mergeScheduler = new ConcurrentMergeScheduler();
     writeLockTimeout = IndexWriterConfig.WRITE_LOCK_TIMEOUT;
     indexingChain = DocumentsWriterPerThread.defaultIndexingChain;
     codec = Codec.Default;
     if (codec == null)
     {
         throw new System.NullReferenceException();
     }
     infoStream = Util.InfoStream.Default;
     mergePolicy = new TieredMergePolicy();
     flushPolicy = new FlushByRamOrCountsPolicy();
     readerPooling = IndexWriterConfig.DEFAULT_READER_POOLING;
     indexerThreadPool = new ThreadAffinityDocumentsWriterThreadPool(IndexWriterConfig.DEFAULT_MAX_THREAD_STATES);
     PerThreadHardLimitMB = IndexWriterConfig.DEFAULT_RAM_PER_THREAD_HARD_LIMIT_MB;
 }