lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonghui Zhao <zhaoyong...@gmail.com>
Subject TieredMergePolicy disrupts doc id order after merge
Date Thu, 28 Sep 2017 12:49:41 GMT
Hi,

It is easier to elaborate my question  with an example.

My lucene version is 4.10.4

I use

SortField sortField =  new SortField(null, SortField.Type.DOC, true);
sort = new Sort(sortField);
return new SortingMergePolicy(new TieredMergePolicy(), sort);


to make sure my index merger will make fresh documents in the beginning of
merged segment.

TieredMergePolicy will chose biggest segments to merge, so the merge order
should be size descending order.

Say we have 2 segments, segment 0 size is smaller than segment 1, after
size sorting merge readers are (segment 1, segment 0),   after merge all
docs in segment 1 are  in front of segment 0.

This doesn't satisfy my requirement.

If merge readers will be restored to origin order after TieredMergePolicy
findMerges, then this problem will be fixed.

Any problem of this solution?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message