mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Rely on FieldIdMapWithMetadata in facet search and filters
This commit is contained in:
parent
67f7470c83
commit
b88aa9cc76
8 changed files with 128 additions and 105 deletions
|
@ -13,7 +13,7 @@ use crate::constants::{self, RESERVED_GEO_FIELD_NAME, RESERVED_VECTORS_FIELD_NAM
|
|||
use crate::database_stats::DatabaseStats;
|
||||
use crate::documents::PrimaryKey;
|
||||
use crate::error::{InternalError, UserError};
|
||||
use crate::fields_ids_map::metadata::FieldIdMapWithMetadata;
|
||||
use crate::fields_ids_map::metadata::{FieldIdMapWithMetadata, MetadataBuilder};
|
||||
use crate::fields_ids_map::FieldsIdsMap;
|
||||
use crate::heed_codec::facet::{
|
||||
FacetGroupKeyCodec, FacetGroupValueCodec, FieldDocIdFacetF64Codec, FieldDocIdFacetStringCodec,
|
||||
|
@ -514,6 +514,16 @@ impl Index {
|
|||
.unwrap_or_default())
|
||||
}
|
||||
|
||||
/// Returns the fields ids map with metadata.
|
||||
///
|
||||
/// This structure is not yet stored in the index, and is generated on the fly.
|
||||
pub fn fields_ids_map_with_metadata(&self, rtxn: &RoTxn<'_>) -> Result<FieldIdMapWithMetadata> {
|
||||
Ok(FieldIdMapWithMetadata::new(
|
||||
self.fields_ids_map(rtxn)?,
|
||||
MetadataBuilder::from_index(self, rtxn)?,
|
||||
))
|
||||
}
|
||||
|
||||
/* fieldids weights map */
|
||||
// This maps the fields ids to their weights.
|
||||
// Their weights is defined by the ordering of the searchable attributes.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue