Esempio n. 1
0
        public BaseLuceneIndexer(IHostingEnvironment environment, AnalyzerFactory analyzerFactory, string subPath)
        {
            _type = typeof(TLuceneEntity);

            _properties = new List <PropertyInfo>(_type.GetProperties());

            _environment = environment;

            luceneIndexStoragePath = Path.Combine(_environment.ContentRootPath, "lucene", subPath);

            _analyzerFactory = analyzerFactory;

            _analyzer = analyzerFactory.Create <TLuceneEntity>();
        }
Esempio n. 2
0
        public SearchProvider(IHostingEnvironment environment,
                              AnalyzerFactory analyzerFactory,
                              string subFolder,
                              ILuceneQueryable <TLuceneEntity> queryProvider)
        {
            _luceneDir = Path.Combine(environment.ContentRootPath, "lucene", subFolder);

            analyzer = analyzerFactory.Create <TLuceneEntity>();

            _indexReader = DirectoryReader.Open(_directory);

            searcher = new Lucene.Net.Search.IndexSearcher(DirectoryReader.Open(_directory));

            _queryProvider = queryProvider;
        }