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

Filter tags by prefix #309

Open
lemon24 opened this issue Jun 5, 2023 · 1 comment
Open

Filter tags by prefix #309

lemon24 opened this issue Jun 5, 2023 · 1 comment

Comments

@lemon24
Copy link
Owner

lemon24 commented Jun 5, 2023

Getting only specific tags with get_tags() is useful when implementing a "class" of objects on top of tags.

Possible use cases:

Open questions:

  • Is prefix match common enough in underlying storages that we can bake it into the API? Likely yes.
  • Idem for case insensitive matching.
  • Should we support both including and excluding tags from the start?
  • Should we also return / sort by the number of resources with that tag?
@lemon24 lemon24 changed the title get_tags() include/exclude prefix Filter tags by prefix Jun 5, 2023
@lemon24
Copy link
Owner Author

lemon24 commented Mar 11, 2024

Some notes on how to implement ~efficient case-insensitive prefix match on SQLite:

  • Per Query Optimizer Overview # The LIKE Optimization, for the optimization to happen, "the column must indexed using built-in NOCASE collating sequence".
  • Since we're adding an index anyway, we might also piggy-back the wildcard (global, any feed, any entry) on it; this should be useful for autocomplete ("give me all entry tags starting with xyz").
    • On further thought, this is needed only if we merge the 3 tag tables (global, feed, entry) into a single one.
  • We need to either disallow % from the prefix (* too, just in case), or escape it with expr LIKE 'a\%b%' ESCAPE '\'.

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

1 participant