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

Handle queries with wildcard at the front better #12

Open
TheOriginalSoni opened this issue Feb 17, 2024 · 2 comments
Open

Handle queries with wildcard at the front better #12

TheOriginalSoni opened this issue Feb 17, 2024 · 2 comments

Comments

@TheOriginalSoni
Copy link
Contributor

Right now queries like https://nutrimatic.org/?q=_*word&go=Go either take forever to load, or just go straight to resource limit exceeded. You need workarounds like https://nutrimatic.org/?q=A%7B4%2C10%7D%26_*word&go=Go to make those queries work.

In comparision, queries with wildcards at the back like https://nutrimatic.org/?q=word_*&go=Go have never faced any errors at all.

Maybe something can be done to let Nutrimatic handle things better both directions?

@TheOriginalSoni
Copy link
Contributor Author

Someone mentioned reverse trie earlier about this

@egnor
Copy link
Collaborator

egnor commented Feb 17, 2024

One could certainly build a reverse index (at the expense of doubling index size...) but even that wouldn't be general, because _*word_* will be slow regardless. But maybe suffix searching is common enough to be worth indexing for?

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

No branches or pull requests

2 participants