Probably a question for Mike M.
Is it possible/sensible to use IndexDeletionPolicy to remove the *newest*
commit points (as opposed to the usual scenario of deleting old commit points).
I experimented with this:
class RollbackDeletionPolicy implements IndexDeletionPolicy
{
public void onCommit(List commits) throws IOException {
}
public void onInit(List commits) throws IOException {
IndexCommit commit=(IndexCommit)commits.get(commits.size()-1);
commit.delete();
}
}
....
And opening and closing a writer...
void myRollback()
{
IndexWriter w=new IndexWriter(dir,analyzer, new
RollbackDeletionPolicy(),
MaxFieldLength.UNLIMITED);
w.close();
}
This mostly worked but segments.gen was not updated to reflect the regression
in the list of active segments. Is there an API somewhere to reinstate the
segments.gen file?
I assume I would also need to take care to close all readers before attempting
a rollback-to-earlier-commitpoint.
Cheers,
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]