开始

是否记录文档打分

的最大值?

更新maxScore

u3_seg0 u3_seg1
u4_seg0 u4_seg1

堆是否已满?

u6_seg0 u6_seg1

FieldComparator

添加该文档号

u8_seg0 u8_seg1

u11_seg0 u11_seg1 u11_seg2 u11_seg3 u11_seg4

添加文档信息

到堆中

u14_seg0 u14_seg1

堆是否已满?

u16_seg0 u16_seg1

FieldComparator

设置bottom

结束

u19_seg0 u19_seg1 u19_seg2 u19_seg3
u20_seg0 u20_seg1 u20_seg2 u20_seg3 u20_seg4
u21_seg0 u21_seg1

collectedAllCompetitiveHits

是否为true?

u25_seg0 u25_seg1
u26_seg0 u26_seg1 u26_seg2

是否大于堆顶元素?

u30_seg0 u30_seg1

FieldComparator

替换bottom

u33_seg0 u33_seg1

替换堆顶元素

u35_seg0 u35_seg1

是否可以提前

结束域比较?

u37_seg0 u37_seg1

u40_seg0 u40_seg1 u40_seg2

是否可以提前结束

Collector的收集工作

u43_seg0 u43_seg1

设置collectedAllCompetitiveHits

为true

u45_seg0 u45_seg1
u46_seg0 u46_seg1 u46_seg2

估算剩余满足查询条件的文档数量

设置earlyTerminated

为true

抛出CollectionTerminatedException

u51_seg0 u51_seg1 u51_seg2
u52_seg0 u52_seg1
u53_seg0 u53_seg1
u54_seg0 u54_seg1
u55_seg0 u55_seg1 u55_seg2