Skip to content

Commit

Permalink
add some log
Browse files Browse the repository at this point in the history
Signed-off-by: bowenlan-amzn <[email protected]>
  • Loading branch information
bowenlan-amzn committed Jun 6, 2024
1 parent 3d3b447 commit 9528f4f
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ private Collector pickCollector(LeafReaderContext ctx) throws IOException {
if (parent == null && subAggregators.length == 0 && valuesSourceConfig.missing() == null && valuesSourceConfig.script() == null) {
Terms terms = ctx.reader().terms(valuesSourceConfig.fieldContext().field());
if (terms != null) {
logger.debug("dynamic pruning for shard {} segment {}", context.indexShard().shardId(), ctx.ord);
Weight weight = context.searcher().createWeight(context.searcher().rewrite(context.query()), ScoreMode.TOP_DOCS, 1f);
Bits liveDocs = ctx.reader().getLiveDocs();
BulkScorer scorer = weight.bulkScorer(ctx);
Expand Down Expand Up @@ -294,7 +295,11 @@ public void collect(int doc, long owningBucketOrd) throws IOException {
} while (queue.size() > 1 && top.doc == curTopDoc);
}

logger.debug("after pruning top doc {}", top.doc);
if (queue.size() == 0) {
logger.debug("queue size is 0");
} else {
logger.debug("after pruning top doc {}", top.doc);
}
// after pruning, queue top doc will exceed current doc
// but in the scoring process, we have a contract that every iteration or nextDoc
// iterator: 0 - 1 - 2 - 3 - ...
Expand Down

0 comments on commit 9528f4f

Please sign in to comment.