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

Boost exact matches in suggestions #93

Closed
wants to merge 1 commit into from
Closed

Boost exact matches in suggestions #93

wants to merge 1 commit into from

Conversation

thiemowmde
Copy link
Contributor

This orders the suggestions into five groups:

  1. Exact matches in brackets, e.g. when searching for "foo", Bar (foo) will be shown first.
  2. Exact prefixes in brackets, e.g. Bar (foo-bar) (yes, this is a little optimization for the special case of languages with sub-languages).
  3. Prefixes, e.g. Fooxyz (xyz).
  4. Prefixes in brackets, e.g. Bar (fooxyz).
  5. Whatever is left, e.g. Xyzfoo (xyz).

Ordering inside the groups will be alphabetical.

Bug: 67395

@snaterlicious
Copy link
Contributor

Apart from the detail that I would prefer "promote" over "boost", the logic appears to be quite specific and does not belong into the basic suggester widget. There should be a derivative (probably something like $.ui.languagesuggester) to put the logic into.

@thiemowmde
Copy link
Contributor Author

We can change the name, no problem. I tried hard to make the thing not specific. The only detail thats specific to language codes is the second booster with the dash.

@snaterlicious
Copy link
Contributor

I am sorry, but after thinking about that over and over again, I am even more convinced that all of the functionality does not belong into the generic suggester.
Taking a step back, the suggester widget has become unmaintainable before the rewrite. Still, it is a quite complex widget and every kind of new functionality should be checked whether its implementation justifies the increase in complexity.
I think, altering the order of the results in any way is nothing that should be part of the generic suggester. One question that struck my mind is: Is it really done by reordering only? In many cases, you would have a visual hint why/that suggestions are ordered in a particular way. CSS class(es), highlighting matched characters and such things. Reordering can easily become opening a can of worms which is probably why the basic jQuery.ui.autocomplete does nothing more than the plain filtering as well.
OK now, such extended functionality could be injected. But then again, that functionality tends to be so specific (even more in combination with visualization) that I regard creating a sub-widget the better and cleaner alternative. That is what is done for siteselector, entityselector, entitysearch, suggestcommons and pagesuggester which all have their own specifics.

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