Class: LuceneQuery::Fuzzy
- Inherits:
-
Object
- Object
- LuceneQuery::Fuzzy
- Defined in:
- lib/lucene_query.rb
Instance Method Summary collapse
-
#initialize(term, boost = nil) ⇒ Fuzzy
constructor
A new instance of Fuzzy.
- #to_lucene ⇒ Object
Constructor Details
#initialize(term, boost = nil) ⇒ Fuzzy
Returns a new instance of Fuzzy.
111 112 113 |
# File 'lib/lucene_query.rb', line 111 def initialize(term, boost=nil) @term, @boost = term, boost end |
Instance Method Details
#to_lucene ⇒ Object
115 116 117 118 119 |
# File 'lib/lucene_query.rb', line 115 def to_lucene @term.split(/\s+/).map { |t| @boost ? "%s~%1.1f" % [t.escape_lucene, @boost] : "%s~" % t.escape_lucene } * " " end |