public void Init() { facetHandlers = new List <IFacetHandler>(); directory = new RAMDirectory(); analyzer = new WhitespaceAnalyzer(); IndexWriter writer = new IndexWriter(directory, analyzer, true, IndexWriter.MaxFieldLength.UNLIMITED); Document doc = new Document(); AddMetaDataField(doc, PathHandlerName, new String[] { "/a/b/c", "/a/b/d" }); writer.AddDocument(doc); writer.Commit(); PathFacetHandler pathHandler = new PathFacetHandler("path", true); facetHandlers.Add(pathHandler); }
public void Init() { facetHandlers = new List <IFacetHandler>(); directory = new RAMDirectory(); analyzer = new WhitespaceAnalyzer(LuceneVersion.LUCENE_48); IndexWriterConfig config = new IndexWriterConfig(LuceneVersion.LUCENE_48, analyzer); config.SetOpenMode(OpenMode.CREATE); IndexWriter writer = new IndexWriter(directory, config); Document doc = new Document(); AddMetaDataField(doc, PathHandlerName, new String[] { "/a/b/c", "/a/b/d" }); writer.AddDocument(doc); writer.Commit(); PathFacetHandler pathHandler = new PathFacetHandler("path", true); facetHandlers.Add(pathHandler); }