mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
rewrite indexed_pos -> field_id for hightligths
This commit is contained in:
parent
130fb74928
commit
21d122a870
3 changed files with 33 additions and 2 deletions
|
@ -167,6 +167,15 @@ impl Schema {
|
|||
self.indexed_map.get(&id)
|
||||
}
|
||||
|
||||
pub fn indexed_pos_to_field_id<I: Into<IndexedPos>>(&self, pos: I) -> Option<FieldId> {
|
||||
let indexed_pos = pos.into().0 as usize;
|
||||
if indexed_pos < self.indexed.len() {
|
||||
Some(self.indexed[indexed_pos as usize])
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
pub fn update_ranked<S: Into<String>>(&mut self, data: impl IntoIterator<Item = S>) -> SResult<()> {
|
||||
self.ranked = HashSet::new();
|
||||
for name in data {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue