[FEATURE REQUEST] BoundingBox intersections

Hello,
I have to index items which besides having a location , can move inside a zone.
There is currently no special attribute to index “zones”, only “locations” (_geoloc).

Would it be possible to add this kind of special attributes ?
Also it would be great to filter by boundingBox intersections ( -> indexed boundingBox touch / contains / is contained by the queried bounding box)

1 Like

Hi there,

Indeed, there is currently no such functionality. I’ll forward this feature request internally.

Can you give us a bit more context? What’s your specific use case? Can you give us an example?

Meanwhile, with a bit of hacks, you can achieve a few similar things. For example, you could index your bbox or polygons points as _geolocs and when you search with a bbox filter, it will “intersect” with your bbox records.
Also, depending on the number of records per bbox search, you could manually do the intersections with multi-queries and front-end filtering. Definitely not optimal but depending on the use case, this could do the trick

2 Likes

Hello, thanks for the answer,
I would prefer not to generate hundred (thousands ?) of coordinates for every indexed object, nor calling multiple times the api as it is a big performance / maintanability issue.

Context :

The indexed objects are users, from their settings, they can set their location and their “mobility”.
Mobility is actually “How far can you go”.

Because of our current logic, mobility is not linked to the user location (so not a radius of location) but can be any zone in the world.

So a user living in Paris, France can set is mobility to Spain, Europe, London, etc…

Within our search engine, you can filter by mobility, So if I ask something like “I want all users who could go up to Paris”
I expect it to display all users who set their mobility to a bounding box [containing / contained by / touching the bounding box] of Paris.

So these should match : France, Paris 10, Europe;
These shouldn’t: London, Lyon, Russia

I understand this seems a bit specific but I’m sure there is a lot of other use cases.

Thanks