FAQ
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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org

Search Discussions

  • Michael McCandless at Jun 23, 2008 at 10:53 pm
    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: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Sebastin at Jun 23, 2008 at 11:36 pm
    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.(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: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org

    --
    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: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Michael McCandless at Jun 24, 2008 at 3:46 pm
    Are you by any chance, separately, removing files from your index
    directory manually? That's the one case I know of which can lead to
    that exception, if you also have an IndexReader open on the directory
    at that time.

    The code below has one problem. In your if statement true & false
    clauses, you declare "IndexWriter writer = ...", but, this means you
    cannot use the "writer" variable outside of those scopes. So I don't
    see how that code can work.

    Mike

    Sebastin wrote:
    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: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org

    --
    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: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedJun 23, '08 at 10:07p
activeJun 24, '08 at 3:46p
posts4
users2
websitelucene.apache.org

2 users in discussion

Sebastin: 2 posts Michael McCandless: 2 posts

People

Translate

site design / logo © 2022 Grokbase