aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/completion.coffee
diff options
context:
space:
mode:
authorStephen Blott2015-05-28 10:22:46 +0100
committerStephen Blott2015-05-28 10:22:48 +0100
commitded18f3bb0eb8cf2e559ff44a46564fd002a4b33 (patch)
treee66ee1e3f28cb6cc2ca4da409708c5111749f2e6 /background_scripts/completion.coffee
parenta3002fe93e6d9f69f7f12f3695becf307e59bb89 (diff)
downloadvimium-ded18f3bb0eb8cf2e559ff44a46564fd002a4b33.tar.bz2
Custom-only: remove omniSearchWeightOption.
This option is no longer needed, since we don't do search completion except for custom searches.
Diffstat (limited to 'background_scripts/completion.coffee')
-rw-r--r--background_scripts/completion.coffee10
1 files changed, 5 insertions, 5 deletions
diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee
index 6f0b9a73..aa7ed4bc 100644
--- a/background_scripts/completion.coffee
+++ b/background_scripts/completion.coffee
@@ -10,7 +10,7 @@
# - refresh(): (optional) refreshes the completer's data source (e.g. refetches the list of bookmarks).
# - cancel(): (optional) cancels any pending, cancelable action.
class Suggestion
- showRelevancy: false # Set this to true to render relevancy when debugging the ranking scores.
+ showRelevancy: true # Set this to true to render relevancy when debugging the ranking scores.
constructor: (@options) ->
# Required options.
@@ -54,6 +54,7 @@ class Suggestion
<div class="vimiumReset vomnibarTopHalf">
<span class="vimiumReset vomnibarSource #{insertTextClass}">#{insertTextIndicator}</span><span class="vimiumReset vomnibarSource">#{@type}</span>
<span class="vimiumReset vomnibarTitle">#{@highlightQueryTerms Utils.escapeHtml @title}</span>
+ #{relevancyHtml}
</div>
"""
else
@@ -466,7 +467,7 @@ class SearchEngineCompleter
{ keyword, searchUrl, description } = engine
extend request, searchUrl, customSearchMode: true
- factor = Math.max 0.0, Math.min 1.0, Settings.get "omniSearchWeight"
+ factor = 0.5
haveCompletionEngine = CompletionSearch.haveCompletionEngine searchUrl
# This filter is applied to all of the suggestions from all of the completers, after they have been
@@ -519,7 +520,6 @@ class SearchEngineCompleter
highlightTermsExcludeUrl: true
isCustomSearch: true
relevancyFunction: @computeRelevancy
- relevancyData: factor
cachedSuggestions =
if haveCompletionEngine then CompletionSearch.complete searchUrl, queryTerms else null
@@ -544,7 +544,7 @@ class SearchEngineCompleter
# lowest-ranked suggestion from another completer (and there are already 10 suggestions), then
# there's no need to query the completion engine.
perfectRelevancyScore = @computeRelevancy new Suggestion
- queryTerms: queryTerms, title: queryTerms.join(" "), relevancyData: factor
+ queryTerms: queryTerms, title: queryTerms.join " "
if 10 <= suggestions.length and perfectRelevancyScore < suggestions[suggestions.length-1].relevancy
console.log "skip (cannot make the grade):", suggestions.length, query if SearchEngineCompleter.debug
@@ -560,7 +560,7 @@ class SearchEngineCompleter
# scores here, and those provided by other completers.
# - Relevancy depends only on the title (which is the search terms), and not on the URL.
Suggestion.boostRelevancyScore 0.5,
- relevancyData * RankingUtils.wordRelevancy queryTerms, title, title
+ 0.7 * RankingUtils.wordRelevancy queryTerms, title, title
postProcessSuggestions: (request, suggestions) ->
return unless request.searchEngines