Class: Ferret::Search::NonMatchingScorer

Inherits:
Scorer
  • Object
show all
Defined in:
lib/ferret/search/non_matching_scorer.rb

Overview

A scorer that matches no document at all.

Constant Summary

Constants inherited from Scorer

Scorer::MAX_DOCS

Instance Attribute Summary

Attributes inherited from Scorer

#similarity

Instance Method Summary collapse

Methods inherited from Scorer

#doc, #each_hit, #each_hit_up_to, #score

Constructor Details

#initializeNonMatchingScorer

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

Returns:

  • (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