I am not seeing the problem. One small thing is that you don't need to
make another Reader...you can get the one from the IndexSearcher. But I
dont see why your are getting that error...that is the type of error you
would get if you were trying to use IndexReaders Protected constructor
outside the index package...but you are correctly using the static open
call...
Thanks very much for your reply. I am having problems creating an
IndexReader object for this purpose. This is the relevant code for my
method:
public List wildSearch(File indexDir) throws Exception {
List searchResult = new ArrayList();
Directory fsDir=FSDirectory.getDirectory(indexDir);
IndexSearcher is = new IndexSearcher(fsDir);
IndexReader ir = new IndexReader().open(fsDir);
Analyzer analyser = new StandardAnalyzer();
Query parser=new WildcardQuery(new Term("LINES", "?rr*"));
parser=parser.rewrite(ir);
long start=new Date().getTime();
Hits hits=is.search(parser);
long end=new Date().getTime();
QueryScorer scorer = new QueryScorer(parser);
Highlighter highlighter = new Highlighter(scorer);
The error I am getting in eclipse is, "cannot instantiate the type
IndexReader". What am I doing wrong?
I am able to use the Highlighter class with a boolean search, but not with
the WildCard search, nor with the Fuzzy search. Any suggestions?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]