开始

是否记录文档打分

的最大值?

更新maxScore

u120_seg0 u120_seg1
u121_seg0 u121_seg1

堆是否已满?

u123_seg0 u123_seg1

FieldComparator

添加该文档号

u125_seg0 u125_seg1 u125_seg2 u125_seg3

u128_seg0 u128_seg1 u128_seg2 u128_seg3 u128_seg4

添加文档信息

到堆中

u131_seg0 u131_seg1

堆是否已满?

u133_seg0 u133_seg1

FieldComparator

设置bottom

结束

u136_seg0 u136_seg1 u136_seg2 u136_seg3
u137_seg0 u137_seg1 u137_seg2 u137_seg3 u137_seg4
u138_seg0 u138_seg1

collectedAllCompetitiveHits

是否为true?

u142_seg0 u142_seg1
u143_seg0 u143_seg1 u143_seg2

是否大于堆顶元素?

u147_seg0 u147_seg1

FieldComparator

替换bottom

u150_seg0 u150_seg1 u150_seg2 u150_seg3

替换堆顶元素

u152_seg0 u152_seg1

是否可以提前

结束域比较?

u154_seg0 u154_seg1

u157_seg0 u157_seg1 u157_seg2

是否可以提前结束

Collector的收集工作

u160_seg0 u160_seg1

设置collectedAllCompetitiveHits

为true

u162_seg0 u162_seg1
u163_seg0 u163_seg1 u163_seg2

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

设置earlyTerminated

为true

抛出CollectionTerminatedException

u168_seg0 u168_seg1 u168_seg2
u169_seg0 u169_seg1
u170_seg0 u170_seg1
u171_seg0 u171_seg1
u172_seg0 u172_seg1 u172_seg2

是否已经被收集了?

u176_seg0 u176_seg1 u176_seg2
u177_seg0 u177_seg1

是否已经被收集了?

u181_seg0 u181_seg1
u182_seg0 u182_seg1 u182_seg2