DECAFFMEYER MATHIEU wrote:
Hi, I have exactly the same question.
Correct me if I'm wrong :
it seems that I can do any I/O operations on the index while querying
because of the open IndexReader.
So if I had the same situation as gui (the poster of the thread), I can
just delete the old index while people query on it ?
Then build a new index and re-open an indexreader on it ?
Opening an index dir with "create=true" while readers are using it is
not well supported in Lucene currently.
I think it will work fine on UNIX ("delete on last close" file
semantics), but on Windows you will get access denied errors if
you try this. The workaround is to make the new index in a new path
and then swap readers over to that new path at a "good time".
But some good news: this is now fixed in the trunk (not yet in any
release but will be in 2.1 once it's released). We re-use the same
retry logic that's normally used by a writer when deleting files, to
avoid problems with access denied errors on Windows.
Also, beware the deadly LUCENE-140:
http://issues.apache.org/jira/browse/LUCENE-140
which causes silent index corruption if you use the wrong "create =
true". Both FSDirectory and IndexWriter take "create" (this was
confusing and is also fixed in trunk). You should use both
FSDirectory's "create=true" and IndexWriter's "create=true" to prevent
that corruption.
Mike
-----Original Message-----
From: Guilherme Barile [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 31, 2007 2:56 PM
To: java-user@lucene.apache.org
Subject: Recreating an index
***** This message comes from the Internet Network *****
Hello, I have a system that uses lucene to index information contained
on text files, one register per line.
When I start up, I load the text file and create the index, after that,
a Timer starts up, and verifies the file's lastModified() attribute, if
that changed, I need to recreate the index.
The problem is, I can't just delete the old index and create a new one,
because people are querying it. The idea is to create a temporary index,
and when it's done, substitute the old index with the new one.
Any tips on doing that ?
Thanks a lot
gui
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
============================================
Internet communications are not secure and therefore Fortis Banque Luxembourg
S.A. does not accept legal responsibility for the contents of this message. The
information contained in this e-mail is confidential and may be legally
privileged. It is intended solely for the addressee. If you are not the
intended recipient, any disclosure, copying, distribution or any action taken
or omitted to be taken in reliance on it, is prohibited and may be unlawful.
Nothing in the message is capable or intended to create any legally binding
obligations on either party and it is not intended to provide legal advice.
============================================
---------------------------------------------------------------------
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]