lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajive Dave <hardtopm...@yahoo.com>
Subject Exception while merging indexes
Date Tue, 22 Oct 2002 18:43:09 GMT
Hi All,

I am trying to merge different indexes into one index
and I get following excpetion. The program I used to
merge the indexes is at the end of the email. 

When I list the segmentnames in the segments files in 
the corresponding index directory I see the particular
segment (_87aa) in the index but no files associated
with the index. I have no idea what happened. 

I did try to merge this index with others onece beofre
and it successfully completed. But its failing now.
More interestingly it fails while optimizing ( I had
print line is optimize call ). 

Looks like there is some problem with remerging the
index which has already been merged before.
Theoretically it shoudln't be the problem becuase
merge program is just reading the index and writing a
new merged one . Any help will be appreciated.

Thanks
Rajive 

java.io.FileNotFoundException:
/data0/indexRep/index/_87aa.fnm (No such file or
directory)
        at java.io.RandomAccessFile.open(Native
Method)
        at
java.io.RandomAccessFile.<init>(RandomAccessFile.java:93)
        at
java.io.RandomAccessFile.<init>(RandomAccessFile.java:138)
        at
org.apache.lucene.store.FSInputStream$Descriptor.<init>(FSDirectory.java:253)
        at
org.apache.lucene.store.FSInputStream.<init>(FSDirectory.java:261)
        at
org.apache.lucene.store.FSDirectory.openFile(FSDirectory.java:210)
        at
org.apache.lucene.index.FieldInfos.<init>(FieldInfos.java:78)
        at
org.apache.lucene.index.SegmentReader.<init>(SegmentReader.java:103)
        at
org.apache.lucene.index.IndexWriter.mergeSegments(IndexWriter.java:381)
        at
org.apache.lucene.index.IndexWriter.mergeSegments(IndexWriter.java:365)
        at
org.apache.lucene.index.IndexWriter.optimize(IndexWriter.java:261)
        at
org.apache.lucene.index.IndexWriter.addIndexes(IndexWriter.java:318)
        at MergeIndex.main(MergeIndex.java:26)


public class  MergeIndex
{
  public static void main(String[] args) {
    try {
      Date start = new Date();
      System.out.println(start.getTime());
      IndexWriter writer = new IndexWriter("index",
new StandardAnalyzer(), true);

      String [] dirs = args  ;
      FSDirectory [] luceneDirs = new FSDirectory
[dirs.length];
      for ( int i = 0 ; i < dirs.length ; i ++ )
      {
         luceneDirs[i] = 
FSDirectory.getDirectory(dirs[i],false);
      }

      writer.addIndexes(luceneDirs);

      writer.optimize();
      writer.close();

      Date end = new Date();

      System.out.print(end.getTime() -
start.getTime());
      System.out.println(" total milliseconds");

    } catch (Exception e) {
      e.printStackTrace();
      System.out.println(" caught a " + e.getClass() +
                         "\n with message: " +
e.getMessage());
    }
  }
}


__________________________________________________
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/

--
To unsubscribe, e-mail:   <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>


Mime
View raw message