github-actions[bot] commented on code in PR #68815:
URL: https://github.com/apache/doris/pull/68815#discussion_r4227661849
##########
be/src/format_v2/table/lance_reader.cpp:
##########
@@ -1177,6 +1202,17 @@ Status
LanceTableReader::_configure_vector_search(LanceScanner* scanner,
}
}
+ if (vector.__isset.distance_lower_bound ||
vector.__isset.distance_upper_bound) {
+ const float lower = static_cast<float>(vector.distance_lower_bound);
+ const float upper = static_cast<float>(vector.distance_upper_bound);
+ // nearest() clears the range; install bounds only after setting the
query vector.
+ if (lance_scanner_set_distance_range(
Review Comment:
[P1] Apply bounded ranges after exact scoring for lossy indexes. With an
IVF_SQ index whose training bounds are [0,255], stored [0.49,0] and query
[0.51,0] both quantize to [0,0]. For [0.0001,0.001), the pinned Lance [indexed
range
check](https://github.com/lance-format/lance/blob/68c12dfd7efe02f90ad2d7f3a239a7eb64884e57/rust/lance-index/src/vector/flat/index.rs#L184-L214)
drops the approximate distance 0 before refine_factor=1 can rescore it to the
exact 0.0004; a flat scan returns the row even with full partition probing and
enough top_k. Route bounded SQ/PQ scans through an exact path or defer the
bound until original-vector scoring, and test threshold crossings.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]