Skip to content
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

[Core] Add condition GeoBoundingBoxCondition #365

Closed
ker0x opened this issue Feb 20, 2024 · 4 comments · Fixed by #420
Closed

[Core] Add condition GeoBoundingBoxCondition #365

ker0x opened this issue Feb 20, 2024 · 4 comments · Fixed by #420
Labels
features New feature or request help wanted Extra attention is needed SEAL Core Seal Core related issue

Comments

@ker0x
Copy link
Contributor

ker0x commented Feb 20, 2024

I open this issue following my PR (#420) to introduce a new GeoBoundingBoxCondition condition. According to my research, almost all search engines seem to support geographic search within a bounding box. Only Loupe does not implement this feature yet.

For the moment, I've only implemented it on Meilisearch.

@alexander-schranz alexander-schranz added features New feature or request SEAL Core Seal Core related issue help wanted Extra attention is needed labels Feb 20, 2024
@alexander-schranz
Copy link
Member

Thx for the issue and the links to the different engines 👍

@ker0x ker0x mentioned this issue Sep 14, 2024
12 tasks
@alexander-schranz
Copy link
Member

alexander-schranz commented Sep 15, 2024

Some research data not complete yet how different search engines do a bounding box query or polygon based queries:

Search Engine GeoBoundingBox Algorithm Link
Meilisearch ↙️ Top Right -> Bottom Left Docs
Algolia ↘️ Top Left -> Bottom Right
↪️ Polygon
Docs
Elasticsearch ↘️ Top Left -> Bottom Right
↪️ Polygon
Docs
Opensearch ↘️ Top Left -> Bottom Right
↪️ Polygon
Docs
Typesense ↪️ Polygon right handed (lat, lon, lat, ..) Docs
Solr ↗️ Bottom Left -> Top Right
↪️ Polygon (lat lon, lat ...) (requires additional .jar JTS / Geo3d)
Docs
Redisearch ↪️ Polygon right handed?? Docs
Loupe ⚫ No support yet Docs

Meilisearch expected Top Right -> Bottom Left, while most others go on Top Left and Bottom Right. Polygon based queries are normally counter clockwise (right handed rule) but they seems in most cases just use the shortest distance.

Lot of documentation reference for polygon search also Well Known text representation of geometry https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry

@alexander-schranz
Copy link
Member

alexander-schranz commented Sep 15, 2024

Interesting info MapBox uses Top Right (northEast) and Bottom Left (southWest):

https://docs.mapbox.com/help/glossary/bounding-box/

Same for Google maps uses:

https://developers.google.com/maps/documentation/javascript/reference/coordinates#LatLngBounds

It seems also why Meilisearch changed its behaviour to make things maybe easier in JS as you can then directly forward them to filter correctly: meilisearch/specifications#223

@alexander-schranz
Copy link
Member

moved the missing part (RediSearch) into own ticket: #422

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
features New feature or request help wanted Extra attention is needed SEAL Core Seal Core related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants