1 5 package org.enhydra.snapper.wrapper.lucene; 6 7 import org.enhydra.snapper.api.*; 8 import org.enhydra.snapper.api.searching.*; 9 import org.enhydra.snapper.api.logging.LoggingManager; 10 11 14 public class LuceneSearcherFactory implements SearcherFactory { 15 16 protected static LoggingManager logger; 17 Searcher searcher = null; 18 19 22 public void configure(LoggingManager logger) { 23 LuceneSearcherFactory.logger = logger; 24 try { 25 26 29 searcher = new LuceneSearcher(); 30 } catch (Exception ex) { 32 System.out.println("Error on creating Searcher" + ex); 33 } 34 35 36 } 37 38 public Searcher getSearcher(){ 39 return searcher; 40 } 41 42 public Searcher newSearcher(){ 43 searcher = new LuceneSearcher(); 44 return searcher; 46 } 47 48 public void removeSearcher(){ 49 searcher = null; 50 } 51 52 } 53 | Popular Tags |