Skip to content

Commit 88a8a82

Browse files
emmaling27Convex, Inc.
authored and
Convex, Inc.
committed
Make comments about num_deleted_terms more accurate (#27354)
I got confused reading the comments talking about "completely deleted" terms because to me that sounds like a unique count. I made this clear that we are counting non-unique terms (e.g. if I delete "a" and "a" again, the num_deleted_terms is 2). GitOrigin-RevId: 2bfaa7160c2eb6307ed6e542efde98ebbd55fff1
1 parent 19018a9 commit 88a8a82

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

crates/text_search/src/tracker.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ use crate::metrics::{
6464
/// - field_header_size (little-endian u16): length of the header describing the
6565
/// deleted terms table for each field
6666
/// - field_id (little-endian u32): field id
67-
/// - num_terms_deleted (little-endian u64): number of terms that are completely
68-
/// deleted from the segment
67+
/// - num_terms_deleted (little-endian u64): number of non-unique terms that
68+
/// were deleted from the segment
6969
/// - deleted_term_ordinals_size (little-endian u32): size of the term ordinals
7070
/// EliasFano
7171
/// - counts_size (little-endian u32): size of the DacsOpt encoded counts of
@@ -91,7 +91,8 @@ struct DeletedTermsTable {
9191
/// Number of documents deleted for each term, corresponding to the order in
9292
/// term_ordinals.
9393
term_documents_deleted: DacsOpt,
94-
/// Number of terms that are completed deleted from the field in the segment
94+
/// Number of non-unique terms that were deleted from the field in the
95+
/// segment
9596
num_terms_deleted: u64,
9697
}
9798

@@ -280,8 +281,7 @@ impl StaticDeletionTracker {
280281
.context("doc_frequency underflow")
281282
}
282283

283-
/// How many terms have been completely deleted from the term dictionary for
284-
/// a field?
284+
/// Number of non-unique terms that have been deleted from a field
285285
pub fn num_terms_deleted(&self, field: Field) -> u64 {
286286
self.deleted_terms_by_field
287287
.get(&field)

0 commit comments

Comments
 (0)