From ab185a59b5a969f76013670cb61c6892e435f32d Mon Sep 17 00:00:00 2001 From: ad hoc Date: Tue, 5 Apr 2022 09:46:56 +0200 Subject: [PATCH] fix infos --- infos/src/main.rs | 26 ++++++++++++++++++++++++-- milli/src/update/delete_documents.rs | 2 -- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/infos/src/main.rs b/infos/src/main.rs index 6a270833b..05c168233 100644 --- a/infos/src/main.rs +++ b/infos/src/main.rs @@ -29,6 +29,8 @@ const ALL_DATABASE_NAMES: &[&str] = &[ FACET_ID_STRING_DOCIDS, FIELD_ID_DOCID_FACET_F64S, FIELD_ID_DOCID_FACET_STRINGS, + EXACT_WORD_DOCIDS, + EXACT_WORD_PREFIX_DOCIDS, DOCUMENTS, ]; @@ -384,10 +386,11 @@ fn biggest_value_sizes(index: &Index, rtxn: &heed::RoTxn, limit: usize) -> anyho field_id_word_count_docids, facet_id_f64_docids, facet_id_string_docids, + exact_word_docids, + exact_word_prefix_docids, field_id_docid_facet_f64s: _, field_id_docid_facet_strings: _, documents, - .. } = index; let main_name = "main"; @@ -437,6 +440,14 @@ fn biggest_value_sizes(index: &Index, rtxn: &heed::RoTxn, limit: usize) -> anyho } } + for result in exact_word_docids.remap_data_type::().iter(rtxn)? { + let (word, value) = result?; + heap.push(Reverse((value.len(), word.to_string(), word_docids_name))); + if heap.len() > limit { + heap.pop(); + } + } + for result in word_prefix_docids.remap_data_type::().iter(rtxn)? { let (word, value) = result?; heap.push(Reverse((value.len(), word.to_string(), word_prefix_docids_name))); @@ -445,6 +456,14 @@ fn biggest_value_sizes(index: &Index, rtxn: &heed::RoTxn, limit: usize) -> anyho } } + for result in exact_word_prefix_docids.remap_data_type::().iter(rtxn)? { + let (word, value) = result?; + heap.push(Reverse((value.len(), word.to_string(), word_prefix_docids_name))); + if heap.len() > limit { + heap.pop(); + } + } + for result in docid_word_positions.remap_data_type::().iter(rtxn)? { let ((docid, word), value) = result?; let key = format!("{} {}", docid, word); @@ -968,8 +987,9 @@ fn size_of_databases(index: &Index, rtxn: &heed::RoTxn, names: Vec) -> a facet_id_string_docids, field_id_docid_facet_f64s, field_id_docid_facet_strings, + exact_word_prefix_docids, + exact_word_docids, documents, - .. } = index; let names = if names.is_empty() { @@ -993,6 +1013,8 @@ fn size_of_databases(index: &Index, rtxn: &heed::RoTxn, names: Vec) -> a FACET_ID_STRING_DOCIDS => facet_id_string_docids.as_polymorph(), FIELD_ID_DOCID_FACET_F64S => field_id_docid_facet_f64s.as_polymorph(), FIELD_ID_DOCID_FACET_STRINGS => field_id_docid_facet_strings.as_polymorph(), + EXACT_WORD_DOCIDS => exact_word_docids.as_polymorph(), + EXACT_WORD_PREFIX_DOCIDS => exact_word_prefix_docids.as_polymorph(), DOCUMENTS => documents.as_polymorph(), unknown => anyhow::bail!("unknown database {:?}", unknown), diff --git a/milli/src/update/delete_documents.rs b/milli/src/update/delete_documents.rs index 58c4d4f70..b347aae38 100644 --- a/milli/src/update/delete_documents.rs +++ b/milli/src/update/delete_documents.rs @@ -473,8 +473,6 @@ fn remove_from_word_prefix_docids( } } - drop(iter); - Ok(prefixes_to_delete.into_set()) }