diff options
| author | Stephen Blott | 2015-05-02 12:14:16 +0100 |
|---|---|---|
| committer | Stephen Blott | 2015-05-02 14:35:49 +0100 |
| commit | 41495d11e6608767dde299223f10c8a606d4a8fb (patch) | |
| tree | fc9242889c5daa478fa26961dfe108a319b433c3 /background_scripts/completion.coffee | |
| parent | 1257fc7a4fe7b9d0bfe1ad7ab7255f8dba4b988d (diff) | |
| download | vimium-41495d11e6608767dde299223f10c8a606d4a8fb.tar.bz2 | |
Search completion; minor tweaks.
Including:
- Make completers classes. That way, we may be able to get better
code reuse.
Diffstat (limited to 'background_scripts/completion.coffee')
| -rw-r--r-- | background_scripts/completion.coffee | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index 40c0d119..d8cf1667 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -326,7 +326,6 @@ class SearchEngineCompleter filter: (queryTerms, onComplete) -> SearchEngines.complete Settings.get("searchUrl"), queryTerms, (suggestions = []) => - console.log suggestions.length characterCount = queryTerms.join("").length completions = for suggestion in suggestions @@ -335,11 +334,11 @@ class SearchEngineCompleter onComplete completions computeRelevancy: (suggestion) -> - # We score search-engine completions by word relevancy, but weight increasingly as the number of + # We score search-engine completions by word relevancy, but weight the score increasingly as the number of # characters in the query terms increases. The idea is that, the more the user has had to type, the less - # likely it is that one of the other suggestion types has found what they're looking for, so the more - # likely it is that this suggestion will be useful. - # (1.0 - (1.0 / suggestion.characterCount)) * + # likely it is that one of the other suggestion types has proven useful, so the more likely it is that + # this suggestion will be useful. + # NOTE(smblott) This will require tweaking. (Math.min(suggestion.extraRelevancyData, 12)/12) * RankingUtils.wordRelevancy suggestion.queryTerms, suggestion.title, suggestion.title |
