コード例 #1
0
        public void UnsetBatchValueTakesTransaction()
        {
            IFullTextSession         fullTextSession    = Search.CreateFullTextSession(OpenSession());
            SearchFactoryImpl        searchFactory      = (SearchFactoryImpl)fullTextSession.SearchFactory;
            LuceneIndexingParameters indexingParameters = searchFactory.GetIndexingParameters(searchFactory.GetDirectoryProviders(typeof(DocumentTop))[0]);

            Assert.AreEqual(10, (int)indexingParameters.BatchIndexParameters.MergeFactor);
            Assert.AreEqual(1000, (int)indexingParameters.BatchIndexParameters.MaxBufferedDocs);
            Assert.AreEqual(99, (int)indexingParameters.BatchIndexParameters.TermIndexInterval);
            fullTextSession.Close();
        }
コード例 #2
0
        public void BatchParametersDefault()
        {
            IFullTextSession         fullTextSession    = Search.CreateFullTextSession(OpenSession());
            SearchFactoryImpl        searchFactory      = (SearchFactoryImpl)fullTextSession.SearchFactory;
            LuceneIndexingParameters indexingParameters = searchFactory.GetIndexingParameters(searchFactory.GetDirectoryProviders(typeof(Query.Author))[0]);

            Assert.AreEqual(1, (int)indexingParameters.BatchIndexParameters.RamBufferSizeMb);
            Assert.AreEqual(9, (int)indexingParameters.BatchIndexParameters.MaxMergeDocs);
            Assert.AreEqual(1000, (int)indexingParameters.BatchIndexParameters.MaxBufferedDocs);
            Assert.AreEqual(10, (int)indexingParameters.BatchIndexParameters.MergeFactor);
            fullTextSession.Close();
        }
コード例 #3
0
        public void TransactionParameters()
        {
            IFullTextSession         fullTextSession    = Search.CreateFullTextSession(OpenSession());
            SearchFactoryImpl        searchFactory      = (SearchFactoryImpl)fullTextSession.SearchFactory;
            LuceneIndexingParameters indexingParameters = searchFactory.GetIndexingParameters(searchFactory.GetDirectoryProviders(typeof(Query.Book))[0]);

            Assert.AreEqual(4, (int)indexingParameters.TransactionIndexParameters.RamBufferSizeMb);
            Assert.AreEqual(15, (int)indexingParameters.TransactionIndexParameters.MaxMergeDocs);
            Assert.AreEqual(17, (int)indexingParameters.TransactionIndexParameters.MaxBufferedDocs);
            Assert.AreEqual(16, (int)indexingParameters.TransactionIndexParameters.MergeFactor);
            Assert.AreEqual(101, (int)indexingParameters.TransactionIndexParameters.TermIndexInterval);
            fullTextSession.Close();
        }
コード例 #4
0
        private static void ConfigureIndexingParameters(ISearchFactoryImplementor searchFactoryImplementor, IDictionary <string, string> indexProps, IDirectoryProvider provider)
        {
            LuceneIndexingParameters indexingParams = new LuceneIndexingParameters();

            ConfigureProp(
                TRANSACTION + MERGE_FACTOR,
                indexProps,
                delegate(int value)
            {
                indexingParams.BatchIndexParameters.MergeFactor       = value;
                indexingParams.TransactionIndexParameters.MergeFactor = value;
            });

            ConfigureProp(
                TRANSACTION + MAX_MERGE_DOCS,
                indexProps,
                delegate(int value)
            {
                indexingParams.BatchIndexParameters.MaxMergeDocs       = value;
                indexingParams.TransactionIndexParameters.MaxMergeDocs = value;
            });

            ConfigureProp(
                TRANSACTION + MAX_BUFFERED_DOCS,
                indexProps,
                delegate(int value)
            {
                indexingParams.BatchIndexParameters.MaxBufferedDocs       = value;
                indexingParams.TransactionIndexParameters.MaxBufferedDocs = value;
            });

            ConfigureProp(
                TRANSACTION + RAM_BUFFER_SIZE,
                indexProps,
                delegate(int value)
            {
                indexingParams.BatchIndexParameters.RamBufferSizeMb       = value;
                indexingParams.TransactionIndexParameters.RamBufferSizeMb = value;
            });

            ConfigureProp(
                TRANSACTION + TERM_INDEX_INTERVAL,
                indexProps,
                delegate(int value)
            {
                indexingParams.BatchIndexParameters.TermIndexInterval       = value;
                indexingParams.TransactionIndexParameters.TermIndexInterval = value;
            });

            ConfigureProp(
                BATCH + MERGE_FACTOR,
                indexProps,
                delegate(int value)
            {
                indexingParams.BatchIndexParameters.MergeFactor = value;
            });

            ConfigureProp(
                BATCH + MAX_MERGE_DOCS,
                indexProps,
                delegate(int value)
            {
                indexingParams.BatchIndexParameters.MaxMergeDocs = value;
            });

            ConfigureProp(
                BATCH + MAX_BUFFERED_DOCS,
                indexProps,
                delegate(int value)
            {
                indexingParams.BatchIndexParameters.MaxBufferedDocs = value;
            });

            ConfigureProp(
                BATCH + RAM_BUFFER_SIZE,
                indexProps,
                delegate(int value)
            {
                indexingParams.BatchIndexParameters.RamBufferSizeMb = value;
            });

            ConfigureProp(
                BATCH + TERM_INDEX_INTERVAL,
                indexProps,
                delegate(int value)
            {
                indexingParams.BatchIndexParameters.TermIndexInterval = value;
            });

            searchFactoryImplementor.AddIndexingParameters(provider, indexingParams);
        }
コード例 #5
0
 public void AddIndexingParameters(IDirectoryProvider provider, LuceneIndexingParameters indexingParameters)
 {
     dirProviderIndexingParams[provider] = indexingParameters;
 }