mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Refactor the FieldIdMapWithMetadata
**Changes:** The FieldIdMapWithMetadata structure now stores more information about fields. The metadata_for_field function computes all the needed information relying on the user provided data instead of the enriched data (searchable/sortable) which may solve an indexing bug on sortable attributes that was not matching the nested fields. The FieldIdMapWithMetadata structure was duplicated in the embeddings as FieldsIdsMapWithMetadata, so the FieldsIdsMapWithMetadata has been removed in favor of FieldIdMapWithMetadata. The Facet distribution is now relying on the FieldIdMapWithMetadata with metadata to match is a field can be faceted. **Impact:** - searchable attributes matching - searchable attributes weight computation - sortable attributes matching - faceted fields matching - prompt computing - facet distribution
This commit is contained in:
parent
967033579d
commit
4f7ece2411
6 changed files with 281 additions and 143 deletions
|
@ -105,6 +105,11 @@ impl<'indexing> GlobalFieldsIdsMap<'indexing> {
|
|||
|
||||
self.local.name(id)
|
||||
}
|
||||
|
||||
/// Get the metadata of a field based on its id.
|
||||
pub fn metadata(&self, id: FieldId) -> Option<Metadata> {
|
||||
self.local.metadata(id).or_else(|| self.global.read().unwrap().metadata(id))
|
||||
}
|
||||
}
|
||||
|
||||
impl<'indexing> MutFieldIdMapper for GlobalFieldsIdsMap<'indexing> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue