Beispiel #1
0
        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));
        }
Beispiel #2
0
		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;
		}
Beispiel #3
0
		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;
		}
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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);
        }