Class: Ferret::Search::NonMatchingScorer
- Defined in:
- lib/ferret/search/non_matching_scorer.rb
Overview
A scorer that matches no document at all.
Constant Summary
Constants inherited from Scorer
Instance Attribute Summary
Attributes inherited from Scorer
Instance Method Summary collapse
- #explain(doc) ⇒ Object
-
#initialize ⇒ NonMatchingScorer
constructor
A new instance of NonMatchingScorer.
- #next? ⇒ Boolean
- #skip_to(target) ⇒ Object
Methods inherited from Scorer
#doc, #each_hit, #each_hit_up_to, #score
Constructor Details
#initialize ⇒ NonMatchingScorer
Returns a new instance of NonMatchingScorer.
4 5 6 |
# File 'lib/ferret/search/non_matching_scorer.rb', line 4 def initialize() super(nil) # no similarity used end |
Instance Method Details
#explain(doc) ⇒ Object
16 17 18 19 20 |
# File 'lib/ferret/search/non_matching_scorer.rb', line 16 def explain(doc) e = Explanation.new() e.description = "No document matches." return e end |
#next? ⇒ Boolean
8 9 10 |
# File 'lib/ferret/search/non_matching_scorer.rb', line 8 def next? return false end |
#skip_to(target) ⇒ Object
12 13 14 |
# File 'lib/ferret/search/non_matching_scorer.rb', line 12 def skip_to(target) return false end |