Hi, I am using Lucene to index text based files : File file = new File("C:/index"); if(file.exists() == false{ IndexWriter writer = new IndexWriter(file,new StandardAnalyzer(),true); } else { IndexWriter writer = new IndexWriter(file,new StandardAnalyzer(),false); } FileReader fr = new FileReader("C:/source"); BufferedReader br = new BufferedReader (fr); String records = br.readline();
while (records != null) { Document doc = new Document(); doc.add(new Field("indexRecords", indexRecords,Field.Store.NO, Field.Index.TOKENIZED)); doc.add(new Field("storeRecords", storeRecords,Field.Store.YES, Field.Index.NO)); writer.addDocument(doc); records = br.readLine(); if(records == null) { writer.close(); } } it throws the following error java.io.IOException: Cannot overwrite: C:/index/_r.fdt at org.apache.lucene.store.FSDirectory.createOutput(FSDirectory.java:433) at org.apache.lucene.index.FieldsWriter.<init>(FieldsWriter.java:47) at org.apache.lucene.index.DocumentsWriter$ThreadState.init(DocumentsWriter.java:865) at org.apache.lucene.index.DocumentsWriter.getThreadState(DocumentsWriter.java:2391) at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:2434) at org.apache.lucene.index.DocumentsWriter.addDocument(DocumentsWriter.java:2422) at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1445) at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1424) Michael McCandless-2 wrote: > > > Can you describe how you are using Lucene, and provide a full traceback? > > Mike > > Sebastin wrote: > >> >> Hi All, >> >> I am facing this error while doing Indexing text files.can anyone >> guide me >> how to resolve this issue. >> -- >> View this message in context: >> http://www.nabble.com/java.io.Ioexception-cannot-overwrite-fdt-tp18079321p18079321.html >> Sent from the Lucene - Java Users mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/java.io.Ioexception-cannot-overwrite-fdt-tp18079321p18080669.html Sent from the Lucene - Java Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]