Hi all,
            I have 2 different indexes, crawl_1 and crawl_2.
            The following is a part of the code I have...

    96           Path dir_1 = new Path(conf.get("searcher.dir", "crawl_1"));
    97            Path segmentsDir1 = new Path(dir_1, "segments");
    98             FetchedSegments segments_1  = new FetchedSegments(fs,
segmentsDir1.toString(), conf);
    99            IndexReader indexreader_1
=IndexReader.open(conf.get("index.1"));
   100
   101
   102             HitDetails[] details = new
HitDetails[indexreader_1.numDocs()];
   103             for(int i=0;i<indexreader_1.numDocs();i++)
   104                     details[i] =
getDetails(indexreader_1.document(i));
   105
   106        Path dir_2 = new Path(conf.get("searcher.dir", "crawl_2"));
   107        Path segmentsDir2 = new Path(dir_2, "segments");
   108        FetchedSegments segments_2  = new FetchedSegments(fs,
segmentsDir2.toString(), conf);
   109        IndexReader indexreader_2
=IndexReader.open(conf.get("index.2"));
   110
   111        HitDetails[] details1 = new
HitDetails[indexreader_2.numDocs()];
   112        for(int i=0;i<indexreader_2.numDocs();i++)
   113               details1[i] = getDetails(indexreader_2.document(i));
   114
   115       ParseText parsetext = segments_1.getParseText(details[2]);
   116       String contents = parsetext.getText();
   117        ParseText parsetext1 =
segments_english.getParseText(details1[5]);
   118       String contents1 = parsetext1.getText();




When I run the code, it is giving me the following error


java.lang.NullPointerException
        at
org.apache.nutch.searcher.FetchedSegments.getParseText(FetchedSegments.java:152)
        at
org.apache.nutch.searcher.BuildCorpusTest.getDateOfTeluguDocs(BuildCorpusTest.java:117)
        at
org.apache.nutch.searcher.BuildCorpusTest.main(BuildCorpusTest.java:295)


Can u please tell me wht might be the problem with the second index?? plz
reply...

Reply via email to