Closed Bug 956681 Opened 10 years ago Closed 10 years ago

Change order of autocomplete results, give higher priority to wordwise startsWith matches (over contains matches)

Categories

(Thunderbird :: Address Book, defect)

27 Branch
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED DUPLICATE of bug 970456

People

(Reporter: nONoNonO, Unassigned)

Details

After bug 529584 has been fixed, I need to type more characters of the address I want to send a mail to before the right address is on the top of the list. 
The matching is changed from startsWith to contains.
For instance, when I type an 'o', now all results containing an 'o' with a higher popularityindex than results starting with an 'o' come on top of the list.
It would be better if you would check both startsWith and contains and give the two results a different weight, much like Firefox does in the awesomebar...
It would be even better if you'd also throw in some kind of regexp, so that Thunderbird not only matches on startsWith or contains, but also on the start of a word, so that for "Onno Ekker <o.e.ekker@gmail.com>" you get a higher index when you type an 'o' or an 'e' (or a 'g')...
(In reply to Onno Ekker [:nONoNonO UTC+1] from comment #0)
> After bug 529584 has been fixed, I need to type more characters of the
> For instance, when I type an 'o', now all results containing an 'o' with a

Fortunately, bug 529584 has also made it so that when you type "ekk", you'll actually find yourself instead of finding nothing ;)

> It would be better if you would check both startsWith and contains and give
> the two results a different weight, much like Firefox does in the
> awesomebar...

I'm not sure if they have weighting between startsWith and contains matches, but they certainly have "frecency", which is TB Bug 382415, and desirable indeed to replace inflexible popularityIndex.

> It would be even better if you'd also throw in some kind of regexp, so that
> Thunderbird not only matches on startsWith or contains, but also on the
> start of a word, so that for "Onno Ekker <o.e.ekker@gmail.com>" you get a
> higher index when you type an 'o' or an 'e' (or a 'g')...

In the same line of thought, autocomplete will be much more powerful after we split up multiword search terms and search for each word separately in Bug 558931. The behaviour after that will be very close to what you want for wordwise searching, so e.g. searching for "o. ekk" will definitely find your unique match. For single characters (just "o"), it's obvious we can't expect exact search results unless we implement frecency in Bug 382415.
I think if you use the match function and start the pattern with \b, you don't have to split the search terms and search for each word separately. Only thing you have to take in account is if the search string itself contains metacharacters like ? or * that you need to quote them...
Onno, what you report in comment 0 should have been fixed by Bug 970456, very much in the way you suggested (even the wordwise startsWith thing). Thank you for your constructive feedback.

It's very tricky to get this right, but we discussed and tried hard and Magnus delivered... ;)
Pls confirm if this works for you now on Trunk (TB Daily).
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
Summary: Change order of autocomplete results → Change order of autocomplete results, give higher priority to wordwise startsWith matches (over contains matches)
OS: Windows 7 → All
Hardware: x86 → All
Yup, works great. Thank you Thomas and Magnus! I hope the other addressing widget issues get fixed too soon in 31.x or 38.0.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.