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

Don't use prefix queries/filters #740

Closed
clintongormley opened this issue Jan 9, 2013 · 2 comments
Closed

Don't use prefix queries/filters #740

clintongormley opened this issue Jan 9, 2013 · 2 comments

Comments

@clintongormley
Copy link

To show files by dir/ the query currently uses a prefix filter - a lot of these queries show up in the slow log

Better way to do that would be to use a path hierarchy tokenizer on that field http://www.elasticsearch.org/guide/reference/index-modules/analysis/pathhierarchy-tokenizer.html and then use the match_phrase query to search eg t/foo/bar (match_phrase to make sure they're in the right order)

You probably need something at the beginning of the path, so that you can anchor the search at the beginning as well

@clintongormley
Copy link
Author

An alternative would be to index the dir separately from the file - probably simplest

@ranguard
Copy link
Member

Moving to wishlist https://github.com/CPAN-API/cpan-api/wiki/Wishlist - please let us know if this isn't an issue any more

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