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

[REQUEST] search geohash tags by prefix #265

Open
oren-z0 opened this issue Mar 15, 2023 · 0 comments
Open

[REQUEST] search geohash tags by prefix #265

oren-z0 opened this issue Mar 15, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@oren-z0
Copy link

oren-z0 commented Mar 15, 2023

A typical geohash filter will look for events in a given bounding box, which can be described by a list of geohash prefixes.
Following the discussion here, I think it would be useful if specifying a "*" at the end of a geohash will mean a search for all events with a geohash tag that contains the requested prefix.

I think the change should be somewhere here, but I'm not familiar with Knex. If filterName[1] is "g" and criterion.slice(-1) is "*", then instead of checking that event_tags contain a pair of [filterName[1], criterion], we should check that event_tags contain a pair with a first element of "g" and a second element that starts with criterion.slice(0, -1).

A possible alternative is to assume that every geohash filter that has less than 9 characters is actually a "prefix filter", even if it doesn't end with "*".

Another crazy option is to index every geohash value with all of its prefixes (i.e. for and event containing ["g","dqcjqcpew"], also add to the database ["g","dqcjqcpe"],["g","dqcjqcp"],["g","dqcjqc"],["g","dqcjq"],["g","dqcj"],["g","dqc"],["g","dq"],["g","d"] - this is crazy but will make the queries simpler.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants