I want to create a lucene index and I use the following code :
Analyzer analyzer = new StopAnalyzer();
IndexWriter writer = new IndexWriter( "mydir", analyzer, false );
First it gives me Lock obtain timed out: error.
When I remove the lock file from /tmp and run it, it says segment file not
found.
/segments (No such file or directory)
at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:204)
at
org.apache.lucene.store.FSIndexInput$Descriptor.<init>(FSDirectory.java:430)
at org.apache.lucene.store.FSIndexInput.<init>(FSDirectory.java:439)
at
org.apache.lucene.store.FSDirectory.openInput(FSDirectory.java:329)
at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:45)
at
org.apache.lucene.index.IndexWriter$1.doBody(IndexWriter.java:264)
at org.apache.lucene.store.Lock$With.run(Lock.java:99)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:259)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:204)
at BuildIndex.main(BuildIndex.java:28)
Analyzer analyzer = new StopAnalyzer();
IndexWriter writer = new IndexWriter( "mydir", analyzer, false );
First it gives me Lock obtain timed out: error.
When I remove the lock file from /tmp and run it, it says segment file not
found.
/segments (No such file or directory)
at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:204)
at
org.apache.lucene.store.FSIndexInput$Descriptor.<init>(FSDirectory.java:430)
at org.apache.lucene.store.FSIndexInput.<init>(FSDirectory.java:439)
at
org.apache.lucene.store.FSDirectory.openInput(FSDirectory.java:329)
at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:45)
at
org.apache.lucene.index.IndexWriter$1.doBody(IndexWriter.java:264)
at org.apache.lucene.store.Lock$With.run(Lock.java:99)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:259)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:204)
at BuildIndex.main(BuildIndex.java:28)