Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
 public SearchIndex(Action <SearchIndexBuilder> inMemoryIndexBuilder, SearchIndexConfig config)
     : this(CreateInMemoryIndex(inMemoryIndexBuilder, config), true, config)
 {
 }
Ejemplo n.º 3
0
 public SearchIndex(string fileName, SearchIndexConfig config)
     : this(File.Open(fileName, FileMode.Open, FileAccess.Read, FileShare.Read), true, config)
 {
 }