mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
only index _geo if it's set as sortable OR filterable
and only allow the filters if geo was set to filterable
This commit is contained in:
parent
f73273d71c
commit
5bb175fc90
3 changed files with 15 additions and 1 deletions
|
@ -234,7 +234,13 @@ impl<'t, 'u, 'i, 'a> IndexDocuments<'t, 'u, 'i, 'a> {
|
|||
// get filterable fields for facet databases
|
||||
let faceted_fields = self.index.faceted_fields_ids(self.wtxn)?;
|
||||
// get the fid of the `_geo` field.
|
||||
let geo_field_id = self.index.fields_ids_map(self.wtxn)?.id("_geo");
|
||||
let geo_field_id = if let Some(gfid) = self.index.fields_ids_map(self.wtxn)?.id("_geo") {
|
||||
(self.index.sortable_fields_ids(self.wtxn)?.contains(&gfid)
|
||||
|| self.index.filterable_fields_ids(self.wtxn)?.contains(&gfid))
|
||||
.then(|| gfid)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
let stop_words = self.index.stop_words(self.wtxn)?;
|
||||
// let stop_words = stop_words.as_ref();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue