Ideally, we should sort them like this: 1. First should come any entries that start with the typed string, sorted in ascending alphabetical order 2. After those, we show any entries that contain the typed string in another position, also sorted in ascending alphabetical order If the above is too complicated, we can simply sort the entries that contain the typed the string in ascending alphabetical order.
Pushed for review on: http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=adamian/20150309_bugz
Had a look at this, but we need a further tweak: we need to list first the "starts with" matches (sorted in alphabetical order), followed by the "contains" matches (also in alphabetical order).
merged in master
I don't think this is fully working. In a project with the core layers only, if I type "minimal" in one of the target fields, 'xorg-minimal-fonts" shows up before "core-image-minimal".
"xorg-minimal-fonts" come in front of "core-image-minimal" because "minimal" is closer to the start of the match word (4 chars prior compared to 11 chars prior). So the order of the sort is: - closer to the front, it appears first - on same string position, order is alphabetical Did I misunderstand what we the desired behaviour is ?
(In reply to comment #5) > "xorg-minimal-fonts" come in front of "core-image-minimal" because "minimal" > is closer to the start of the match word (4 chars prior compared to 11 chars > prior). > > So the order of the sort is: > - closer to the front, it appears first > - on same string position, order is alphabetical I see. > > Did I misunderstand what we the desired behaviour is ? I should have explained properly. Basically, the whole thing is more binary than your implementation. We make the assumption that users are most likely to type the beginning of whatever it is they are looking for. So we first show the stuff that starts with the search string, sorted in alphabetical order. After that, we show stuff that contains the search string, in any other position, independently of how closer to the front it is. And all those are sorted as a single block, also in alphabetical order. This is because although it is reasonable to assume that you will tend to type the start of what you are looking for, it is probably not so that you are more likely to want stuff that contains the typed string closer to the front when it does not start with it. The other issue with the sorting based on "closer to the front" is that it appears random from the outside. I hope this explains.
Alex, It appears the question has been answered. Please set this back to NEEDINFO it that is not the case. Thanks, Stephen
Moved to New so anybody can take it.
Since the typeahead url/view has now been removed I don't think it is now possible to customise the searching algorithm for just the typeaheads behaviour.
(In reply to comment #9) > Since the typeahead url/view has now been removed I don't think it is now > possible to customise the searching algorithm for just the typeaheads > behaviour. Can I ask why has this been removed? The last usability testing we ran showed how useful this component is, but also how important it is to fine tune its behaviour to make sure we provide the most meaningful results to users. Can we please bring the typeahead back, and start working on refining the suggestions it provides?
Question for Alex
Created attachment 2596 [details] Documentation for sorting typeaheads and table result This document describes the behavior when showing and sorting typeahead suggestions and the results of any Toaster table after a search.
All the information required should be in the attached design document.
Created attachment 2625 [details] Sorting typeaheads documentation
New typeahead widget now in master. This is sorted alphabetically for the match 'starting with' and the secondary results 'contains'. poky aff29d2cd837df90a2897b9b75753e4af30f132e (Bitbake rev: 31a8ae7909347f7b6edde5bbdf02b86dc1b32ed0)
Verified on master: a9053ac0829eb01f6f002587854d01e47a78e6f0