Meilisearch _geo consitency with with Firestore Geopoint
baek-b opened this issue · 5 comments
For _geoRadius to work, the current documentation and workings of Meilisearch requires Geopoint fields in firestore to be renamed as _geo. However, when it comes to the "lat" & "lng" field name formats. Firestore does not allow renaming of these fields. These fields are named "_latitude" & "_longitude" respectively by Firestore. I was unable to do a _geoRadius search on Meiliesearch.
Steps to reproduce the issue:
- Install Meilisearch on GCP - [long story short, it works]
- Create new index and add "_geo" to "filterableAttributes" settings - [Works]
- Install Meilisearch Firestore extension. [Search queries return correct results, including "_geo" fields but with "_latitude" & "_longitude". - [Works]
- Add test documents with _geo in Firestore. - [Works]
- Run empty q search without filter - [Works]
- Run empty q search with {"filter": "_geoRadius( , , )"} - [No results returned]
No results returned even if same value as the document are passed. I don't know if it's because Meilisearch is looking for "lat" & "lng" and can't find anything or something else. Either way, I could find any issues or documentation on this.
I also came across this issue. I'm not sure if anything has been rewritten but the documentation is not update in that case.
So there is an error in the documentation for the firestore repo. It states
If you are using GeoPoint, the field should be named _geo to be recognized by Meilisearch for geosearch.
This compeletely overlooks the fact that firestore doesn't support naming the Latitude and Longitude fields which renders using geopoint for Meilisearch useless.
The way I got this to work is to use a map on firestore with the expected format. i.e.
"_geo": { "lat": 0.0, "lng": "0.0" }
I'll investigate and come back to you asap
I made an issue on firebase side: googleapis/nodejs-firestore#1799 (comment)
I'm still looking for a work-around meanwhile, I'll keep you updated :)
After further investigation, the error comes from my side. I will be fixing this asap!