diff options
| author | Stephen Blott | 2015-05-05 06:14:12 +0100 |
|---|---|---|
| committer | Stephen Blott | 2015-05-05 06:14:12 +0100 |
| commit | 1a9ea85f683c892592d7092c361e835c8b0f4f3e (patch) | |
| tree | 0e191b51fb33aad9711bbf23c06d3844ac86dc63 | |
| parent | 04398df01e57923a4b19319b2b77f487c703ab30 (diff) | |
| download | vimium-1a9ea85f683c892592d7092c361e835c8b0f4f3e.tar.bz2 | |
Search completion; tweak scoring.
| -rw-r--r-- | background_scripts/completion.coffee | 8 | ||||
| -rw-r--r-- | pages/vomnibar.coffee | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index e76139c2..33d8a563 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -353,6 +353,8 @@ class SearchEngineCompleter suggestions.push @mkSuggestion null, queryTerms, type, mkUrl(query), title, @computeRelevancy, 1 suggestions[0].autoSelect = true queryTerms = queryTerms[1..] + else + query = queryTerms.join " " if queryTerms.length == 0 return onComplete suggestions @@ -367,13 +369,11 @@ class SearchEngineCompleter # relevancy). We assume that the completion engine has already factored that in. Also, completion # engines often handle spelling mistakes, in which case we wouldn't find the query terms in the # suggestion anyway. - # - The score is based on the length of the last query term. The idea is that the user is already - # happy with the earlier terms. - # - The score is higher if the last query term is longer. The idea is that search suggestions are more + # - The score is higher if the query term is longer. The idea is that search suggestions are more # likely to be relevant if, after typing some number of characters, the user hasn't yet found # a useful suggestion from another completer. # - Scores are weighted such that they retain the order provided by the completion engine. - characterCount = queryTerms[queryTerms.length - 1].length + characterCount = query.length - queryTerms.length + 1 score = 0.6 * (Math.min(characterCount, 10.0)/10.0) if 0 < existingSuggestions.length diff --git a/pages/vomnibar.coffee b/pages/vomnibar.coffee index 9566d9d9..ff004c6e 100644 --- a/pages/vomnibar.coffee +++ b/pages/vomnibar.coffee @@ -25,7 +25,7 @@ Vomnibar = extend options, userOptions options.refreshInterval = - if options.completer == "omni" then 125 else 50 + if options.completer == "omni" then 125 else 0 completer = @getCompleter(options.completer) @vomnibarUI ?= new VomnibarUI() |
