OK, does this mean it's now relatively safe/lightweight now to hold
references to IndexCommit objects long term (across different
IndexWriter objects on the same Directory?)
I also notice that IndexCommit.equals() only compares the segment fine
name... should it compare version also? If index
Yonik Seeley wrote:
OK, does this mean it's now relatively safe/lightweight now to hold
references to IndexCommit objects long term (across different
IndexWriter objects on the same Directory?)
Yes, this should be fine.
I also notice that IndexCommit.equals() only compares the segment fine
When implementing a custom IndexDeletionPolicy, is it sufficient to just use
the segments filename (returned by IndexCommitPoint.getSegmentsFilename()) to
compare CommitPoints to see if they are equal?
I've looked at the code in SnapshotDeletionPolicy and it works by keeping a
pointer to the
Good questions!
Yes, it's best to use the segments filename to compare commit points
across close/reopen of IndexWriter as long as you ensure you're always
working with the same index / Directory.
You could change snapshot to be a String (the segments file name) and
do all comparisons on that