mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-01-18 17:11:15 +08:00
Fix the infos crate to make it read u16 field ids
This commit is contained in:
parent
a9553af635
commit
0a78107525
@ -7,7 +7,7 @@ use byte_unit::Byte;
|
|||||||
use heed::EnvOpenOptions;
|
use heed::EnvOpenOptions;
|
||||||
use milli::facet::FacetType;
|
use milli::facet::FacetType;
|
||||||
use milli::index::db_name::*;
|
use milli::index::db_name::*;
|
||||||
use milli::{Index, TreeLevel};
|
use milli::{FieldId, Index, TreeLevel};
|
||||||
use structopt::StructOpt;
|
use structopt::StructOpt;
|
||||||
use Command::*;
|
use Command::*;
|
||||||
|
|
||||||
@ -322,7 +322,7 @@ fn most_common_words(index: &Index, rtxn: &heed::RoTxn, limit: usize) -> anyhow:
|
|||||||
fn facet_values_iter<'txn, KC: 'txn, DC: 'txn>(
|
fn facet_values_iter<'txn, KC: 'txn, DC: 'txn>(
|
||||||
rtxn: &'txn heed::RoTxn,
|
rtxn: &'txn heed::RoTxn,
|
||||||
db: heed::Database<KC, DC>,
|
db: heed::Database<KC, DC>,
|
||||||
field_id: u8,
|
field_id: FieldId,
|
||||||
) -> heed::Result<Box<dyn Iterator<Item = heed::Result<(KC::DItem, DC::DItem)>> + 'txn>>
|
) -> heed::Result<Box<dyn Iterator<Item = heed::Result<(KC::DItem, DC::DItem)>> + 'txn>>
|
||||||
where
|
where
|
||||||
KC: heed::BytesDecode<'txn>,
|
KC: heed::BytesDecode<'txn>,
|
||||||
@ -330,7 +330,7 @@ where
|
|||||||
{
|
{
|
||||||
let iter = db
|
let iter = db
|
||||||
.remap_key_type::<heed::types::ByteSlice>()
|
.remap_key_type::<heed::types::ByteSlice>()
|
||||||
.prefix_iter(&rtxn, &[field_id])?
|
.prefix_iter(&rtxn, &field_id.to_be_bytes())?
|
||||||
.remap_key_type::<KC>();
|
.remap_key_type::<KC>();
|
||||||
|
|
||||||
Ok(Box::new(iter))
|
Ok(Box::new(iter))
|
||||||
|
Loading…
Reference in New Issue
Block a user