Closed Bug 276632 Opened 20 years ago Closed 19 years ago

make autocomplete be more like google suggest (make it most popular results come first)

Categories

(MailNews Core :: Address Book, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
mozilla1.8beta5

People

(Reporter: sspitzer, Assigned: mscott)

References

(Blocks 2 open bugs, )

Details

(Keywords: verified1.8)

Attachments

(4 files, 1 obsolete file)

make autocomplete be more like google suggest (make it most popular results come first) here's what I mean: right now, when I type: "e", I get a bunch of results. The first <n> aren't people I send mail to frequently. The person I send mail to all the time is way down, so I usually have to keep typing to get to that email address. let's add an int field to ab card interface and increment it each time the user sends mail (to,cc,bcc) to that address. then, when doing AC, when looking at the results, let's sort by that value.
Severity: normal → enhancement
seems pretty easy for someone to jump in and make this happen...
Status: NEW → ASSIGNED
Target Milestone: --- → Thunderbird1.5
I'd like to add a suggestion: Who I e-mail tends to change over time. It might be better to base the sort on recent data, so addresses to which I _used_ to e-mail all the time don't hang around in the autocomplete area for years after they become invalid. On the other hand, that significantly increases the complexity of implementation, doesn't it? Either implementation would be useful :)
OS: Windows XP → All
Hardware: PC → All
I agree. There's another bug: when you write in To: one address, then write ',' and a letter, the popup doesn't appear... i.e.: test@test.com,b it should show a popup with all emails begginning with 'b'
related Bug 208833 (Sort address completion list by most recent use). depending on how these develop, a blocker or complementary improvement?
Attached patch first cut at a fix (obsolete) — Splinter Review
This patch is a first cut at sorting address book autocomplete results based on popularity (i.e. how often you send e-mail to the address). 1) Adds a data base property for a popularity index 2) Adds a nsIAbCard property for a popularity index 3) When performing address book auto complete, sort matches of the same type (i.e. name exact match results, email exact match results, name matches, email matches, etc.) by popularity. The old code sorted results for each match type by domain name if they matched the default domain. 4) Remove obsolete domain match type code from the address book autocompletion code now that we are inserting based on popularity. 5) Adds code to mail compose to bump the popularity index on send for each outgoing recipient. I'm most concerned about this change because it causes us to call EditCardToDatabase for each recipient on send. Is that going to cause us to force commit the database? I need to make us bump the popularity index on mailing lists too before this patch is really done. Also, this patch leave LDAP autocomplete alone and has no impact on how LDAP results are presented to the user.
Attachment #196881 - Flags: superreview?(bienvenu)
Comment on attachment 196881 [details] [diff] [review] first cut at a fix very cool.
Attachment #196881 - Flags: superreview?(bienvenu) → superreview+
only commits each address book once instead of after updating the popularity count on each address book recipient. the rest of the patch is unchanged. carrying forward david's sr.
Attachment #196881 - Attachment is obsolete: true
Attachment #197117 - Flags: superreview+
I've checked this into the trunk so we can start getting feedback on it.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
I forgot to actually push the address book card change back to the database before the db got committed. I also removed a useless null ptr check since the code bails out earlier if the address book database object is null.
Attachment #197199 - Flags: superreview?(bienvenu)
Attachment #197199 - Flags: superreview?(bienvenu) → superreview+
Attachment #197199 - Attachment description: additional fix → [patch checked in]additional fix
Comment on attachment 197117 [details] [diff] [review] updated fix that is more db friendly "fo" :-P >+ // find the start fo the search results for our particular >+ // match type and then insert into that group of results >+ // sorted by the popularity index >+ while (i < type) >+ insertPosition += mMatchTypeCounters[i++]; >+ >+ while (insertPosition < nbrOfItems) This might code slightly neater as a for loop, also using the known number of matching type saves having to test for the type: PRInt32 lastPosition = insertPosition + mMatchTypeCounters[i]; for (; insertPosition < lastPosition; insertPosition++) { ... if (aPopularityIndex > param->mPopularityIndex) break; }
I wonder if we should get rid of all of the match types: http://lxr.mozilla.org/mozilla/source/mailnews/addrbook/src/nsAbAutoCompleteSession.h#87 with maybe the exception of nick name matches, so those always appear at the top of the list. Let all of the other results get sorted together by popularity, regardless of the match type.
Seth and I were chatting some more about this and we think it makes sense to use the popularity index across all the match types. No more distinguishing auto complete results based on e-mail vs. nick name vs. display name matches. Just sort the entire list based on the popularity index for each match. This patch removes all of the match type information. A couple places still needed to care about whether the match was a default domain / default match so I still pass that information around. I also turned on the old code for appending a default domain to ensure that the default domain item is still the first item in the list when you turn that feature on. Now all matches are sorted based on popularity. Items with the same popularity index are sorted alphabetically. LDAP matches appear at the end of the list like they did before.
Attachment #197616 - Flags: superreview?(bienvenu)
Attachment #197616 - Flags: superreview?(bienvenu) → superreview+
Attachment #197616 - Attachment description: remove notion of match types, sort entire list by popularity → [patch checked in]remove notion of match types, sort entire list by popularity
This patch handles a case Seth was seeing where you have multiple entries in your address book with the same e-mail address. It ensures that we use the match that has the highest popularity index, thus ensuring that the e-mail address appears as high as possible in the autocomplete results list.
Attachment #197941 - Flags: superreview?(bienvenu)
Attachment #197941 - Flags: superreview?(bienvenu) → superreview+
Attachment #197941 - Attachment description: handle duplicate address book entries → [patch checked in] handle duplicate address book entries
Target Milestone: Thunderbird1.5 → Thunderbird1.1
I've put this on the 1.8 branch too. This has no effect on Firefox at all. a=me/bienvenu/sspitzer
Keywords: fixed1.8
*** Bug 279640 has been marked as a duplicate of this bug. ***
(In reply to comment #16) > *** Bug 279640 has been marked as a duplicate of this bug. *** let re-write what have beeb said in bug 279640: (In reply to comment #3) > in 1.5beta 2, we sort by frequency of use, so the addresses you send to more > often will be higher in the list (In reply to comment #4) > note that I used to mail a friend about 400 to 500 times in 6 months, 2 years > ago, and no more now. > > What happens if I write to people let say once a week for 1 year from now ? > > that far less than the 500 for the first one; still, I expect to get the latter > address ... > > volum reflects frequency, you you should average that only on ... let say the > last 6 onths ...
Blocks: 140404
Status: RESOLVED → VERIFIED
Keywords: fixed1.8verified1.8
Component: Message Compose Window → MailNews: Address Book
Product: Thunderbird → Core
Target Milestone: Thunderbird1.1 → mozilla1.8beta5
Product: Core → MailNews Core
It looks like this feature is broken or missing in thunderbird 3.0. Could someone confirm this?
Yes, and fixed in the meanwhile: bug 497722
Blocks: 1114751
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: