-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_geoBoundingBox
filter returns no results when lat
and lng
are indexed as strings
#3973
Comments
Hey @martinmaillard. It seems like you mixed up a bit the order of your latitude/longitude. As you can see in the documentation, the
Following these indications, this means the top right corner should be expressed as |
Hi @irevoire, Sorry, I don't understand your message. Where did I mix up Am I missing something? |
Oops, yes, you’re right. Sorry, I totally misunderstood your issue 🤦 The bug is related to the fact that the |
Ok, I see. Thanks for looking into it :) Maybe the fix is to change the documentation of |
Hey @martinmaillard, just to keep you updated. |
3986: Fix geo bounding box with strings r=ManyTheFish a=irevoire # Pull Request When sending a document with one geofield of type string (i.e.: `{ "_geo": { "lat": 12, "lng": "13" }}`), the geobounding box would exclude this document. This PR fixes this issue by automatically parsing the string value in case we're working on a geofield. ## Related issue Fixes #3973 ## What does this PR do? - Automatically parse the facet value iif we're working on a geofield. - Make insta works with snapshots in loops or closure executed multiple times. (you may need to update your cli if it panics after this PR: `cargo install cargo-insta`). - Add one integration test in milli and in meilisearch to ensure it works forever. - Add three snapshots for the dump that mysteriously disappeared I don't know how Co-authored-by: Tamo <tamo@meilisearch.com>
Fixed by #3986 without downside |
Describe the bug
When indexing documents with a
_geo
key containinglat
andlng
as string values, the_geoBoundingBox
filter never returns any resuls. Reindexing the same documents withlat
andlng
asfloat
values solves the issue.I'm reporting this as a bug because the documentation states that
string
values are valid forlat
andlng
.Note that
_geoRadius
works as expected.To Reproduce
Steps to reproduce the behavior:
[{"id": 1, "_geo": {"lng": "6", "lat": "46"}}, {"id": 2, "_geo": {"lng": 6, "lat": 46}]
{"filter": "_geoBoundingBox([47, 7], [44, 4])"}
id=2
is returnedExpected behavior
Both documents should be returned
Meilisearch version:
Tested with 1.2 and 1.3
Comment from the team:
This issue was an indexing issue. The fix will be shipped in a patch version which means you don't need a dump to use it.
For all the new documents you send, it'll take effect immediately BUT, if your database already contains geo documents with their coordinates as string, you won't be able to query them until you re-index them by removing and then adding again
_geo
as a faceted attribute (i.e.: removing it from both the sortable and filterable attributes).You can also delete and send back all the affected documents if that's easier for you.
The text was updated successfully, but these errors were encountered: