Simplify tie-breaker start bound and doc comment

This commit is contained in:
Luca Cominardi
2026-10-02 09:18:57 +02:00
parent 547524adbe
commit ef0bed7ea3
2 changed files with 5 additions and 7 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ pub(crate) fn serialize_generated_tie_breaker_column(
output: &mut impl Write,
) -> io::Result<()> {
// TODO: Lift this temporary u32 limit once downstream consumers support the full u64 range.
let max_start = u64::from(u32::MAX - num_docs.saturating_sub(1));
let max_start = (u32::MAX - num_docs) as u64;
let start: u64 = rand::rng().random_range(0..=max_start);
let end = start + num_docs as u64;
let values = start..end;
+4 -6
View File
@@ -59,13 +59,11 @@ impl SchemaBuilder {
/// Adds a generated tie-breaker fast field.
///
/// The field is exposed as a `u64` fast field. Its generated values are temporarily limited
/// to the `u32` range for downstream compatibility; this limit will eventually be lifted.
/// Values supplied by documents for this field are ignored.
/// The field is exposed as a `u64` fast field. Values are consecutive within a segment,
/// starting at a random offset. Ranges of different segments may overlap, so values are
/// almost always distinct but not guaranteed to be unique.
///
/// Values are consecutive within a segment, starting at a random offset. Ranges of
/// different segments may overlap, so values are almost always distinct but not
/// guaranteed to be unique.
/// Values supplied by documents for this field are ignored.
///
/// # Panics
///