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

Improvements to geo-coordinate based filtering #4728

Open
1 task done
databyjp opened this issue Apr 19, 2024 · 5 comments
Open
1 task done

Improvements to geo-coordinate based filtering #4728

databyjp opened this issue Apr 19, 2024 · 5 comments

Comments

@databyjp
Copy link
Contributor

Describe your feature request

Challenge
Current implementation of the geo-coordinate filtering uses a vector search. A limitation of the implementation is that the size of the list is fixed to 800.

This limits usefulness of filter when combined with other parameters, as the geo-coordinate search does not accept an allow list, and also it is carried out before being used as an allow list for any subsequent searches.

Proposal

  1. Allow the user to increase the dynamic list size to a larger number, at the cost of speed.
  2. When a geo-coordinate filter is used in combination with other filters, perform the other filters first & pass the results as an allow list to the geo-coordinate filter.

Code of Conduct

@databyjp databyjp changed the title Parameterise geo-coordinate filtering ef parameter Improvements to geo-coordinate based filtering Apr 19, 2024
@mrisher
Copy link

mrisher commented Apr 20, 2024

+1 This was unintuitive and masked some issues with other parts of our retrieval stack; from the documentation I assumed that a nearText combined with withinGeoRange would return all the relevant documents, not a subset.

@crispyadmin
Copy link

Please fix this issue it renders using maps in any mobile app with Weaviate under the hood useless. Make the expected behavior actually work (expand the geo radius as you make the max distance parameter bigger)

Test it for yourselves it's horrible 👨🥹

@databyjp
Copy link
Contributor Author

Please fix this issue it renders using maps in any mobile app with Weaviate under the hood useless. Make the expected behavior actually work (expand the geo radius as you make the max distance parameter bigger)
Test it for yourselves it's horrible 👨🥹

Hey @crispyadmin I understand this is a frustrating issue but let's keep the discussion constructive :). In the meantime, a workaround might be to use geohashing, and then to use filters such as containsAll or containsAny to match sections within X number of tile range.

Note that due to how filters work, substring matches (i.e. LIKE) filters will be slower than exact matches, which is why I recommend using containsAll / containsAny.

Here is a brief explanation of geohashing. https://medium.com/@bkawk/geohashing-20b282fc9655

@crispyadmin
Copy link

can you show a code example of how I would use geohashing with the client?

Sorry geo hashing is quite new to me. So i would convert lat and long to the geohash and then what field am I filtering on in my Weaivate Cluster? Would i still be using my geo field?

@databyjp
Copy link
Contributor Author

Sorry geo hashing is quite new to me. So i would convert lat and long to the geohash and then what field am I filtering on in my Weaivate Cluster? Would i still be using my geo field?

The geohash would be a string, where the longer the matched string the smaller the area is. In the articled that I linked to above, “9q8y” and “9q8z" are subsets of the “9q8” area.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants