public SearchIndex(Stream stream, bool ownStream, SearchIndexConfig config) { if (stream == null) { throw new ArgumentNullException(nameof(stream)); } Config = config; if (config == null) { config = new SearchIndexConfig(); } var container = new SearchIndexContainer(stream, ownStream); var reader = DirectoryReader.Open(container); _container = container; _reader = reader; Searcher = new IndexSearcher(reader); Analyzer = config.AnalyzerInternal; }
public SearchIndex(Action <SearchIndexBuilder> inMemoryIndexBuilder, SearchIndexConfig config) : this(CreateInMemoryIndex(inMemoryIndexBuilder, config), true, config) { }
public SearchIndex(string fileName, SearchIndexConfig config) : this(File.Open(fileName, FileMode.Open, FileAccess.Read, FileShare.Read), true, config) { }