From f62a806f47c30fbf77a8ed2ae6d31e93389ac7ea Mon Sep 17 00:00:00 2001 From: Paul Masurel Date: Mon, 5 Jan 2026 11:15:45 +0100 Subject: [PATCH] Explicit doc for the meaning of intersection_priority --- src/postings/block_segment_postings.rs | 2 +- src/query/weight.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/postings/block_segment_postings.rs b/src/postings/block_segment_postings.rs index f29031fbe..6a91d4c36 100644 --- a/src/postings/block_segment_postings.rs +++ b/src/postings/block_segment_postings.rs @@ -97,8 +97,8 @@ impl BlockSegmentPostingsNotLoaded { /// Seek into the block segment postings directly, possibly avoiding loading its first block. pub fn seek_and_load(self, seek_doc: DocId) -> (BlockSegmentPostings, usize) { let BlockSegmentPostingsNotLoaded(mut block_segment_postings) = self; - block_segment_postings.load_block(); let inner_pos = if seek_doc == 0 { + block_segment_postings.load_block(); 0 } else { block_segment_postings.seek(seek_doc) diff --git a/src/query/weight.rs b/src/query/weight.rs index c6ec9f3d3..4d664ffd3 100644 --- a/src/query/weight.rs +++ b/src/query/weight.rs @@ -146,6 +146,10 @@ pub trait Weight: Send + Sync + 'static { /// Returns a priority number used to sort weights when running an /// intersection. + /// + /// Tweaking this value only impacts performance. + /// A higher priority means that the `.scorer()` will be more likely to be evaluated + /// after the sibling weights, and be passed a higher `seek_doc` value as a result. fn intersection_priority(&self) -> u32 { 20u32 }