Closed Bug 384380 Opened 17 years ago Closed 17 years ago

for url bar autocomplete, search page title for matches

Categories

(Firefox :: Bookmarks & History, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 389491

People

(Reporter: moco, Unassigned)

Details

for url bar autocomplete, search history title for matches.

Here's my example:

1) visit https://bugzilla.mozilla.org/show_bug.cgi?id=383692
2) the title is "hixie's twitter status script causes firefox to leak memory"

in my url bar, I want to type "twitter" or "hixie" and have that link be one of the results.

A better example:

1) visit google, click gmail link (link is http://mail.google.com/mail, redirects you to another page with title of "Gmail".  neither page has gmail in the url)

2) type gmail in the url bar, I'd like http://mail.google.com/mail to be one of the results.
Excuse me Seth, i was playing with nsNavHistoryAutoComplete, i see that the autocomplete code is really complex, making penalties and ordering in more steps...

I don't have yet a full comprehension of search priority for autocomplete, but i was thinking to a query like this:

SELECT p.url, p.title, MAX(p.visit_count) as max_visit_count, p.typed, b.fk
FROM moz_places p
LEFT JOIN moz_bookmarks b ON b.fk = p.id
LEFT JOIN moz_historyvisits v ON v.place_id = p.id
WHERE (p.hidden <> 1 OR p.typed = 1)
AND (
  p.url REGEXP "^(http(s)*://(www\.)*|ftp://(ftp\.)*)*KEYWORD"
  OR (v.id NOTNULL AND p.title LIKE "%KEYWORD%")
)
GROUP BY p.url
ORDER BY max_visit_count DESC,v.visit_date DESC
LIMIT 30

This uses sqlite REGEXP, don't know if it's implemented in our sqlite engine, but it works fine in sqlite explorer. The idea is to directly use REGEXP to search for prefixes, you can put as keyword "http://something" or "something" or "http://www." etc and it will find all occurrencies in places.

this is the search for all, not only typed (change is only in the first where expression)

joining against moz_historyvisits lets you search in historyvisits titles 
  OR (v.id NOTNULL AND p.title LIKE "%KEYWORD%")
using NOTNULL this searchs on title only if item is in historyvisits

it is grouped by url to avoid url duplicates, in case of duplicate it takes the MAX(visit_count), in case 2 items has equal MAX(visit_count) it tries to order by visit_date (exists if item is in historyvisits)

Actually i don't have the full list of priority, but i think that the results can be filtered and ordered as we like them, for example we can put as the first items bookmarks or historyvisits, or order by date instead of visit_count... 

If you have a list of autocomplete priority i could try to come up with a more complete query.
Seth, is this fixed by bug 389491?
> Seth, is this fixed by bug 389491?

yes, it is.  thanks dietrich!
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
Bug 451915 - move Firefox/Places bugs to Firefox/Bookmarks and History. Remove all bugspam from this move by filtering for the string "places-to-b-and-h".

In Thunderbird 3.0b, you do that as follows:
Tools | Message Filters
Make sure the correct account is selected. Click "New"
Conditions: Body   contains   places-to-b-and-h
Change the action to "Delete Message".
Select "Manually Run" from the dropdown at the top.
Click OK.

Select the filter in the list, make sure "Inbox" is selected at the bottom, and click "Run Now". This should delete all the bugspam. You can then delete the filter.

Gerv
Component: Places → Bookmarks & History
QA Contact: places → bookmarks
You need to log in before you can comment on or make changes to this bug.