lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sunil Zanjad" <>
Subject RE: newbi question
Date Mon, 22 Oct 2001 20:19:28 GMT

Except for the import part U have stated everything properly in your source
I tried it out and it works fine.
Hence just check whether the org directory is actually present in the 'D'
drive itself,
and not on some other drive.
I believe that this would surely solve your problem.
Contact me if U wish, I am just a few cubics away...


Sunil Zanjad

-----Original Message-----
From: Parag Dharmadhikari []
Sent: Monday, October 22, 2001 6:36 PM
To: lucene-user
Subject: newbi question

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) {

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

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

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

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,


View raw message