Sridhar Raman wrote:
This way no reader will ever see the changes until you successfully
close the writer. If the machine crashes the index is still in the
starting state as of when the writer was first opened.
Ok, I have a slight doubt in this. Say I have gone ahead with
Approach 1
If I have opened the writer with autoCommit=false, and the system
crashes,
does it mean that the changes made to IdxSrch are lost? If that is
the
case, that might be a problem. What I actually want is something like
this. When the system crashes in between, the search continues to
happen on
the index at T0. But the updates that were done since T0 also
needs to be
preserved. Would that happen if I set autoCommit to false?
I realise that I want the cake and eat it too. But that's the
problem we
face if we keep just a single copy of the index.
Alas, you are right: all changes not committed are lost. Ie on
coming back
up after the crash, you would have to re-index everything again.
Lucene is actually not that far from doing what you're asking for
here. I think
the only thing missing is the ability to open a reader on a prior
commit, rather
than the latest one. If we added that then you could make a custom
deletion
policy that'd keep your T0 commit, as well as commits being done by your
writer, and only remove them when you decide to switch your readers
to the
current commit.
But, realize that even with such a change to Lucene, you would still
lose
everything since the last commit, when the machine crashes.
Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]