Ejemplo n.º 1
0
 public AuthorIndexer(IHostingEnvironment environment,
                      IServiceProvider serviceProvider,
                      AnalyzerFactory analyzerFactory,
                      IUnitOfWork uow) : base(environment, analyzerFactory, "author")
 {
     _environment     = environment;
     _serviceProvider = serviceProvider;
     _uow             = uow;
 }
Ejemplo n.º 2
0
 public SearchEngine(
     IHostingEnvironment environment,
     AnalyzerFactory analyzerFactory,
     SubfolderFactory folderFactory
     )
 {
     _env             = environment;
     _analyzerFactory = analyzerFactory;
     _folderFactory   = folderFactory;
 }
Ejemplo n.º 3
0
 public ArticleIndexer(IHostingEnvironment environment,
                       IRepository <Article> repository,
                       IServiceProvider serviceProvider,
                       AnalyzerFactory analyzerFactory,
                       IUnitOfWork uow) : base(environment, analyzerFactory, "article")
 {
     _environment     = environment;
     _repository      = repository;
     _serviceProvider = serviceProvider;
     _uow             = uow;
 }
Ejemplo n.º 4
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>();
        }
Ejemplo n.º 5
0
        public QueryProvider(
            IHostingEnvironment environment,
            AnalyzerFactory analyzerFactory,
            SubfolderFactory folderFactory
            )
        {
            _boolQuery = new BooleanQuery();
            _current   = _boolQuery;

            //for search purpose
            _env             = environment;
            _analyzerFactory = analyzerFactory;
            _subfolder       = folderFactory.GetFolderName <TLuceneEntity>();
        }
Ejemplo n.º 6
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;
        }