Issue Details (XML | Word | Printable)

Key: LUCENE-672
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Yonik Seeley
Reporter: Yonik Seeley
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Lucene - Java

new merge policy

Created: 14/Sep/06 05:54 PM   Updated: 18/Sep/06 09:22 PM
Return to search
Component/s: Index
Affects Version/s: 2.0.0
Fix Version/s: 2.1

Time Tracking:
Not Specified

Issue Links:
Cloners
 

Resolution Date: 14/Sep/06 06:32 PM



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Yonik Seeley added a comment - 14/Sep/06 06:03 PM
cloned LUCENE-565 to track this separately.

Yonik Seeley added a comment - 14/Sep/06 06:32 PM
I just committed http://issues.apache.org/jira/secure/attachment/12340475/newMergePolicy.Sept08.patch
Thanks for the very thorough job on this patch!

Ning Li added a comment - 16/Sep/06 03:46 AM
A small fix named KeepDocCount0Segment.Sept15.patch is attached to LUCENE-565 (can't attach here).

In mergeSegments(...), if the doc count of a merged segment is 0, it is not added to the index (it should be properly cleaned up). Before LUCENE-672, a merged segment was always added to the index. The use of mergeSegments(...) in, e.g. addIndexes(Directory[]), assumed that behaviour. For code simplicity, this fix restores the old behaviour that a merged segment is always added to the index. This does NOT break any of the good properties of the new merge policy.

TestIndexWriterMergePolicy is slightly modified to fix a bug and to check that segments are probably cleaned up. The patch passes all the tests.


Yonik Seeley added a comment - 18/Sep/06 07:18 PM
Should lowerBound start off as -1 in maybeMergeSegments if we keep 0 sized segments?

Ning Li added a comment - 18/Sep/06 08:54 PM
> Should lowerBound start off as -1 in maybeMergeSegments if we keep 0 sized segments?

Good catch! Although the rightmost disk segment cannot be a 0-sized segment right now, it could be when NewIndexModifier is in.

Shoud I submit a new patch?


Yonik Seeley added a comment - 18/Sep/06 09:22 PM
No need to submit a new patch... I made the change and committed it.