fix infos

This commit is contained in:
ad hoc 2022-04-05 09:46:56 +02:00
parent 59e41d98e3
commit ab185a59b5
No known key found for this signature in database
GPG Key ID: 4F00A782990CC643
2 changed files with 24 additions and 4 deletions

View File

@ -29,6 +29,8 @@ const ALL_DATABASE_NAMES: &[&str] = &[
FACET_ID_STRING_DOCIDS, FACET_ID_STRING_DOCIDS,
FIELD_ID_DOCID_FACET_F64S, FIELD_ID_DOCID_FACET_F64S,
FIELD_ID_DOCID_FACET_STRINGS, FIELD_ID_DOCID_FACET_STRINGS,
EXACT_WORD_DOCIDS,
EXACT_WORD_PREFIX_DOCIDS,
DOCUMENTS, DOCUMENTS,
]; ];
@ -384,10 +386,11 @@ fn biggest_value_sizes(index: &Index, rtxn: &heed::RoTxn, limit: usize) -> anyho
field_id_word_count_docids, field_id_word_count_docids,
facet_id_f64_docids, facet_id_f64_docids,
facet_id_string_docids, facet_id_string_docids,
exact_word_docids,
exact_word_prefix_docids,
field_id_docid_facet_f64s: _, field_id_docid_facet_f64s: _,
field_id_docid_facet_strings: _, field_id_docid_facet_strings: _,
documents, documents,
..
} = index; } = index;
let main_name = "main"; 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::<ByteSlice>().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::<ByteSlice>().iter(rtxn)? { for result in word_prefix_docids.remap_data_type::<ByteSlice>().iter(rtxn)? {
let (word, value) = result?; let (word, value) = result?;
heap.push(Reverse((value.len(), word.to_string(), word_prefix_docids_name))); 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::<ByteSlice>().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::<ByteSlice>().iter(rtxn)? { for result in docid_word_positions.remap_data_type::<ByteSlice>().iter(rtxn)? {
let ((docid, word), value) = result?; let ((docid, word), value) = result?;
let key = format!("{} {}", docid, word); let key = format!("{} {}", docid, word);
@ -968,8 +987,9 @@ fn size_of_databases(index: &Index, rtxn: &heed::RoTxn, names: Vec<String>) -> a
facet_id_string_docids, facet_id_string_docids,
field_id_docid_facet_f64s, field_id_docid_facet_f64s,
field_id_docid_facet_strings, field_id_docid_facet_strings,
exact_word_prefix_docids,
exact_word_docids,
documents, documents,
..
} = index; } = index;
let names = if names.is_empty() { let names = if names.is_empty() {
@ -993,6 +1013,8 @@ fn size_of_databases(index: &Index, rtxn: &heed::RoTxn, names: Vec<String>) -> a
FACET_ID_STRING_DOCIDS => facet_id_string_docids.as_polymorph(), 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_F64S => field_id_docid_facet_f64s.as_polymorph(),
FIELD_ID_DOCID_FACET_STRINGS => field_id_docid_facet_strings.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(), DOCUMENTS => documents.as_polymorph(),
unknown => anyhow::bail!("unknown database {:?}", unknown), unknown => anyhow::bail!("unknown database {:?}", unknown),

View File

@ -473,8 +473,6 @@ fn remove_from_word_prefix_docids(
} }
} }
drop(iter);
Ok(prefixes_to_delete.into_set()) Ok(prefixes_to_delete.into_set())
} }