Skip to content

Commit da8f300

Browse files
committed
rename vars
1 parent 641207e commit da8f300

1 file changed

Lines changed: 19 additions & 13 deletions

File tree

  • src/aggregation/bucket/multi_terms

src/aggregation/bucket/multi_terms/mod.rs

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -181,23 +181,23 @@ pub struct KeyElem {
181181
/// Index into `MultiTermsFieldAccessors::columns`, or `u32::MAX` for synthetic missing.
182182
pub accessor_idx: u32,
183183
/// Raw fast-field u64 value (term ord for Str, `to_u64` encoding for numerics).
184-
pub raw: u64,
184+
pub val: u64,
185185
}
186186

187187
impl KeyElem {
188188
/// Synthetic missing sentinel, resolved directly via `MultiTermsFieldAccessors::missing`.
189189
pub const SYNTHETIC_MISSING: u32 = u32::MAX;
190190

191191
/// Creates a `KeyElem` for a real column value.
192-
pub fn new(accessor_idx: u32, raw: u64) -> Self {
193-
Self { accessor_idx, raw }
192+
pub fn new(accessor_idx: u32, val: u64) -> Self {
193+
Self { accessor_idx, val }
194194
}
195195

196196
/// Creates a `KeyElem` that encodes a synthetic missing value.
197197
pub fn synthetic_missing() -> Self {
198198
Self {
199199
accessor_idx: Self::SYNTHETIC_MISSING,
200-
raw: 0,
200+
val: 0,
201201
}
202202
}
203203

@@ -367,14 +367,14 @@ impl SegmentMultiTermsCollector {
367367
let start = out.len();
368368
out.extend(
369369
col.values_for_doc(doc_id)
370-
.map(|raw| KeyElem::new(accessor_idx as u32, raw)),
370+
.map(|val| KeyElem::new(accessor_idx as u32, val)),
371371
);
372372
if col.get_cardinality().is_multivalue() && out.len() - start > 1 {
373373
let values = &mut out[start..];
374-
values.sort_unstable_by_key(|elem| elem.raw);
374+
values.sort_unstable_by_key(|elem| elem.val);
375375
let mut unique_index = 0;
376376
for i in 1..values.len() {
377-
if values[i].raw != values[unique_index].raw {
377+
if values[i].val != values[unique_index].val {
378378
unique_index += 1;
379379
values[unique_index] = values[i];
380380
}
@@ -390,7 +390,7 @@ impl SegmentMultiTermsCollector {
390390
}
391391
}
392392

393-
fn visit(
393+
fn collect_field_value_combinations(
394394
doc_id: crate::DocId,
395395
field_idx: usize,
396396
prefix: &mut MultiTermsKey,
@@ -404,9 +404,15 @@ impl SegmentMultiTermsCollector {
404404
for &elem in &field_values[field_idx] {
405405
prefix.push(elem);
406406
if is_last {
407-
Self::emit(doc_id, prefix, buckets, sub_agg, bucket_id_provider);
407+
Self::record_field_value_combination(
408+
doc_id,
409+
prefix,
410+
buckets,
411+
sub_agg,
412+
bucket_id_provider,
413+
);
408414
} else {
409-
Self::visit(
415+
Self::collect_field_value_combinations(
410416
doc_id,
411417
field_idx + 1,
412418
prefix,
@@ -420,7 +426,7 @@ impl SegmentMultiTermsCollector {
420426
}
421427
}
422428

423-
fn emit(
429+
fn record_field_value_combination(
424430
doc_id: crate::DocId,
425431
key: &MultiTermsKey,
426432
buckets: &mut FxHashMap<MultiTermsKey, MultiTermsBucket>,
@@ -594,7 +600,7 @@ impl SegmentAggregationCollector for SegmentMultiTermsCollector {
594600
}
595601
}
596602

597-
Self::visit(
603+
Self::collect_field_value_combinations(
598604
doc_id,
599605
0,
600606
&mut prefix,
@@ -1172,7 +1178,7 @@ fn resolve_key_elem(
11721178
}
11731179

11741180
let (col, col_type) = &field_acc.columns[elem.accessor_idx as usize];
1175-
resolve_column_value(elem.raw, col_type, &field_acc.str_dict_column, col)
1181+
resolve_column_value(elem.val, col_type, &field_acc.str_dict_column, col)
11761182
}
11771183

11781184
/// Convert a raw u64 from a specific column type to an [`IntermediateKey`].

0 commit comments

Comments
 (0)