You should instantiate the writer with create=true :

      IndexWriter(store, StandardAnalyzer, True )

Because with create=False, an existing index is expected.

David <[EMAIL PROTECTED]> wrote on 14/01/2007 23:56:23:

> Hi all:
>     I want first erase the original index and then create an index for
> appending, I use the following python code using ports pyLucene.
>
>    def store(doc)
>         store = PyLucene.FSDirectory.getDirectory("index", True)
>         writer = PyLucene.IndexWriter(store, StandardAnalyzer, False ) #
> error occurs in this line!
>         writer.addDocument(doc);
>         writer.optimize()
>         writer.close()
>    if __name__ == '__main__':
>         store(doc1)
>         store(doc2)
>
>     But I get the following errors:
>
>  File "D:\work\contentstore\contentstore\backends\lucene\base.py", line
30,
> in store
>     writer = PyLucene.IndexWriter(store, self.analyzer, False )
> PyLucene.JavaError: java.io.FileNotFoundException:
> D:\work\contentstore\contentstore\backends\lucene\index\segments: The
system
> cannot find the file specified.
>
>     How to fix it?
> Appreciate your help!
>
> --
> David


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to