From 45e0feab4e8e3dad6fb469c4223b6a189491c085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Tue, 17 Nov 2020 21:18:34 +0100 Subject: [PATCH] Speed up the facets stats infos subcommand --- src/subcommand/infos.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/subcommand/infos.rs b/src/subcommand/infos.rs index 535045392..3b9c174b8 100644 --- a/src/subcommand/infos.rs +++ b/src/subcommand/infos.rs @@ -407,6 +407,7 @@ fn facet_values_docids(index: &Index, rtxn: &heed::RoTxn, debug: bool, field_nam } fn facet_stats(index: &Index, rtxn: &heed::RoTxn, field_name: String) -> anyhow::Result<()> { + use heed::types::ByteSlice; use crate::facet::FacetType; use crate::heed_codec::facet::{ FacetValueStringCodec, FacetLevelValueF64Codec, FacetLevelValueI64Codec, @@ -423,17 +424,17 @@ fn facet_stats(index: &Index, rtxn: &heed::RoTxn, field_name: String) -> anyhow: let iter = index.facet_field_id_value_docids.prefix_iter(&rtxn, &[field_id])?; let iter = match field_type { FacetType::String => { - let iter = iter.remap_key_type::() + let iter = iter.remap_types::() .map(|r| r.map(|_| 0u8)); Box::new(iter) as Box> }, FacetType::Float => { - let iter = iter.remap_key_type::() + let iter = iter.remap_types::() .map(|r| r.map(|((_, level, _, _), _)| level)); Box::new(iter) }, FacetType::Integer => { - let iter = iter.remap_key_type::() + let iter = iter.remap_types::() .map(|r| r.map(|((_, level, _, _), _)| level)); Box::new(iter) },