public void Initialize() { _cwsDir = new RAMDirectory(); _pdfDir = new RAMDirectory(); _simpleDir = new RAMDirectory(); _conventionDir = new RAMDirectory(); //get all of the indexers and rebuild them all first var indexers = new IIndexer[] { IndexInitializer.GetUmbracoIndexer(_cwsDir), IndexInitializer.GetSimpleIndexer(_simpleDir), IndexInitializer.GetUmbracoIndexer(_conventionDir) }; foreach (var i in indexers) { try { i.RebuildIndex(); } finally { var d = i as IDisposable; if (d != null) d.Dispose(); } } //now get the multi index searcher for all indexes _searcher = IndexInitializer.GetMultiSearcher(_pdfDir, _simpleDir, _conventionDir, _cwsDir); }
public DisposableSearcher(MultiIndexSearcher searcher) { _searcher = searcher; }
public static MultiIndexSearcher GetMultiSearcher(Lucene.Net.Store.Directory pdfDir, Lucene.Net.Store.Directory simpleDir, Lucene.Net.Store.Directory conventionDir, Lucene.Net.Store.Directory cwsDir) { var i = new MultiIndexSearcher(new[] { pdfDir, simpleDir, conventionDir, cwsDir }, new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29)); return i; }