public SearchableIndex GetSearchIndex() { string text = Path.Combine(this.basedir, "search_index"); if (System.IO.Directory.Exists(text)) { return(SearchableIndex.Load(text)); } text = Path.Combine(ConfigurationManager.AppSettings["docDir"], "search_index"); return(SearchableIndex.Load(text)); }
public static SearchableIndex Load (string dir) { SearchableIndex s = new SearchableIndex (); s.dir = dir; s.Results = new ArrayList (20); try { s.searcher = new IndexSearcher (dir); } catch (IOException) { Console.WriteLine ("Index nonexistent or in bad format"); return null; } return s; }
public static SearchableIndex Load (string dir) { SearchableIndex s = new SearchableIndex (); s.dir = dir; s.Results = new ArrayList (20); try { //s.searcher = new IndexSearcher (dir); // TODO: parametrize that depending if we run on the desktop (low footprint) or the server (use RAMDirectory for instance) s.searcher = new IndexSearcher (FSDirectory.Open (dir)); } catch (IOException) { Console.WriteLine ("Index nonexistent or in bad format"); return null; } return s; }
public static SearchableIndex Load(string dir) { SearchableIndex s = new SearchableIndex(); s.dir = dir; s.Results = new ArrayList(20); try { s.searcher = new IndexSearcher(dir); } catch (IOException) { Console.WriteLine("Index nonexistent or in bad format"); return(null); } return(s); }
public static SearchableIndex Load(string dir) { SearchableIndex s = new SearchableIndex(); s.dir = dir; s.Results = new ArrayList(20); try { //s.searcher = new IndexSearcher (dir); // TODO: parametrize that depending if we run on the desktop (low footprint) or the server (use RAMDirectory for instance) s.searcher = new IndexSearcher(FSDirectory.Open(dir)); } catch (IOException) { Console.WriteLine("Index nonexistent or in bad format"); return(null); } return(s); }