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

Fix fuzzy search lookup issues #2396

Merged
merged 2 commits into from
Feb 28, 2017
Merged

Fix fuzzy search lookup issues #2396

merged 2 commits into from
Feb 28, 2017

Conversation

lightpriest
Copy link

@lightpriest lightpriest commented Feb 5, 2017

PR includes a couple of modifications to the fuzzy search:

  1. Fixes Expression browser metric autocomplete misses certain search terms #2380 (81d37a0)
  2. Improves the results returned by the fuzzy search library (93d20d2)

Or Cohen added 2 commits February 5, 2017 16:20
For some of the queries, the fuzzy lookup was not filtering properly.
The problem is due to the "replace" beind made on the query itself. It
accidently removes only the first underscore. This patch changes it so
that it removes all of the whitespaces, letting the fuzzy algorithm do
its magic, also fixing this problem.

Originally, the underscore were replaced by a space for this specific
reason, to let the user type a space and have the lookup treat it as the
word break.

Fixes #2380
The fuzzy library didn't try to find a "best match", but settled on the
first fuzzy match that exists. This patch includes a modified version of
the fuzzy library, which recursivley tries on the rest of the search
string to find a better match. If found, returns that one.

Another small modification is that if a pattern fully matches, it
skips the lookup entirley and returns the highest score possible for
that match.
@fabxc
Copy link
Contributor

fabxc commented Feb 28, 2017

@juliusv this fixes the issue you filed. Can you give it a spin?

@juliusv
Copy link
Member

juliusv commented Feb 28, 2017

@fabxc Thanks for the reminder!

@lightpriest Sorry for the delay. It seems to work nicely for me, thanks a lot!

@juliusv juliusv merged commit 7e14533 into prometheus:master Feb 28, 2017
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

Successfully merging this pull request may close these issues.

3 participants