mozilla / universal-search-addon

DEPRECATED please check new add-on at this link -->
https://github.com/mozilla/universal-search
6 stars 6 forks source link

PlacesSearch: improve relevance by adding omitted adaptive queries #179

Open jaredhirsch opened 8 years ago

jaredhirsch commented 8 years ago

PlacesSearch runs one query, where the production code runs up to nine:

// production code comments from UnifiedComplete.js:
    // For any given search, we run many queries/heuristics:
    // 1) by alias (as defined in SearchService)
    // 2) inline completion from search engine resultDomains
    // 3) inline completion for hosts (this._hostQuery) or urls (this._urlQuery)
    // 4) directly typed in url (ie, can be navigated to as-is)
    // 5) submission for the current search engine
    // 6) Places keywords
    // 7) adaptive learning (this._adaptiveQuery)
    // 8) open pages not supported by history (this._switchToTabQuery)
    // 9) query based on match behavior
    //
    // (6) only gets ran if we get any filtered tokens, since if there are no
    // tokens, there is nothing to match. This is the *first* query we check if
    // we want to run, but it gets queued to be run later.
    //
    // (1), (4), (5) only get run if actions are enabled. When actions are
    // enabled, the first result is always a special result (resulting from one
    // of the queries between (1) and (6) inclusive). As such, the UI is
    // expected to auto-select the first result when actions are enabled. If the
    // first result is an inline completion result, that will also be the
    // default result and therefore be autofilled (this also happens if actions
    // are not enabled).

There are concerns about this addon's results relevance being noticeably poorer, so let's bring over (some? all?) the missing additional queries and additional heuristics.

Note that our implementation filters out search result pages, but those are returned by the production code.

The goal is to have pretty much the same results in production vs our addon, but it's not clear how to measure this reliably. So, just bring over the missing code, verify it locally, and see what the feedback is after a release.

jaredhirsch commented 8 years ago

To enable the iframe to mix results, be sure to continue to add frecency to the list of columns retrieved by additional queries.