Hi all,

I am new to lucene and I can not understand why I am getting following error
with this program?

public class Search {
  public static void main(String[] args) {

        try{
    String indexPath = "d:\\org", queryString = "parag";

    Searcher searcher = new IndexSearcher(indexPath);
    Query query = QueryParser.parse(queryString, "body",
                              new SimpleAnalyzer());
    Hits hits = searcher.search(query);

    for (int i=0; i<hits.length(); i++) {
      System.out.println(hits.doc(i).get("path") + "; Score: " +
                         hits.score(i));
        }
        }
        catch(Exception e)
        {
                System.out.println(e.getMessage());
        }
  }
}

ERROR: the error I am getting is that it throws IOException saying that can
not find org directory in D: (which is there with a file).
Can anybody help me? So that I can read a file from directory and search
with given criterion.

Thanx in advance,

Regards
parag


Reply via email to