Example #1
0
        public IndexFacetedReadOperation(string indexName,
                                         Dictionary <string, IndexField> fields,
                                         LuceneVoronDirectory directory,
                                         IndexSearcherHolder searcherHolder,
                                         Transaction readTransaction,
                                         DocumentDatabase documentDatabase)
            : base(indexName, LoggingSource.Instance.GetLogger <IndexFacetedReadOperation>(documentDatabase.Name))
        {
            try
            {
                _analyzer = CreateAnalyzer(() => new LowerCaseKeywordAnalyzer(), fields, forQuerying: true);
            }
            catch (Exception e)
            {
                throw new IndexAnalyzerException(e);
            }

            _releaseReadTransaction = directory.SetTransaction(readTransaction, out _state);
            _currentStateHolder     = searcherHolder.GetStateHolder(readTransaction);
            _searcher = _currentStateHolder.GetIndexSearcher(_state);
        }
Example #2
0
        public IndexFacetedReadOperation(Index index,
                                         IndexDefinitionBase indexDefinition,
                                         LuceneVoronDirectory directory,
                                         IndexSearcherHolder searcherHolder,
                                         QueryBuilderFactories queryBuilderFactories,
                                         Transaction readTransaction,
                                         DocumentDatabase documentDatabase)
            : base(index, LoggingSource.Instance.GetLogger <IndexFacetedReadOperation>(documentDatabase.Name))
        {
            try
            {
                _analyzer = CreateAnalyzer(() => new LowerCaseKeywordAnalyzer(), indexDefinition, forQuerying: true);
            }
            catch (Exception e)
            {
                throw new IndexAnalyzerException(e);
            }

            _queryBuilderFactories  = queryBuilderFactories;
            _releaseReadTransaction = directory.SetTransaction(readTransaction, out _state);
            _currentStateHolder     = searcherHolder.GetStateHolder(readTransaction);
            _searcher = _currentStateHolder.GetIndexSearcher(_state);
        }