lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: IndexDeletionPolicy and optimized indices
Date Tue, 01 Jul 2008 12:14:24 GMT

You're right IndexCommit doesn't know that it represents an optimized  

Likewise, IndexCommit doesn't know other "semantic" things about the  
index, eg, you've just called expungeDeletes, or, you just finished  
adding batch X of documents to the index, etc.

Also, realize that with autoCommit=false (to be the only choice in  
3.0), no commit will be done after an optimize.  Ie you have to call  
commit() or close() explicitly to make it a commit.

I think the simplest general approach to "know" which commit points  
represent "interesting" times to the application would be to call  
IW.optimize() then IW.commit() (if you are using trunk) or just  
IW.close(), then look at the last IndexCommit passed to your deletion  
policy's onCommit() and record yourself that this commit was the  
result of an optimize.


Shalin Shekhar Mangar wrote:

> Hi,
> I'm implementing a custom IndexDeletionPolicy. An IndexCommit object
> does not have any information whether it's index is optimized or not.
> How can a IndexDeletionPolicy know which IndexCommit instances
> corresponded to optimized indices?
> -- 
> Regards,
> Shalin Shekhar Mangar.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message