public static IServiceCollection AddLuceneProvider(this IServiceCollection services) { var luceneConfig = new LuceneConfig { BatchSize = BooleanQuery.MaxClauseCount, LuceneVersion = LuceneVersion.LUCENE_48 }; services.AddSingleton(luceneConfig); services.AddScoped <IIndexProvider, LuceneIndexProvider>(); return(services); }
public LuceneIndexProvider( LuceneConfig luceneConfig, IDocumentMapper mapper, ILoggerFactory loggerFactory, ILocalIndexPathFactory localIndexPathFactory) { _luceneConfig = luceneConfig; _mapper = mapper; _localIndexPathFactory = localIndexPathFactory; _logger = loggerFactory.CreateLogger <LuceneIndexProvider>(); // Ensures the directory exists EnsureDirectoryExists(); }
public LuceneService(Lucene.Net.Store.Directory directory, Analyzer analyzer, LuceneConfig luceneConfig) { this.directory = directory; this.analyzer = analyzer; this.luceneConfig = luceneConfig; }