Class: LuceneQuery::QueryBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/lucene_query.rb

Overview

DSL Helpers

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.generate(*args, &block) ⇒ Object



124
125
126
# File 'lib/lucene_query.rb', line 124

def self.generate(*args, &block)
  new.generate(*args, &block)
end

Instance Method Details

#And(*terms) ⇒ Object



133
# File 'lib/lucene_query.rb', line 133

def And(*terms) And.new(*terms) end

#Field(key, val) ⇒ Object



132
# File 'lib/lucene_query.rb', line 132

def Field(key, val) Field.new(key, val) end

#Fuzzy(*args) ⇒ Object



141
# File 'lib/lucene_query.rb', line 141

def Fuzzy(*args) Fuzzy.new(*args) end

#generate(&block) ⇒ Object



128
129
130
# File 'lib/lucene_query.rb', line 128

def generate(&block)
  instance_eval(&block)
end

#In(field, terms) ⇒ Object



135
136
137
# File 'lib/lucene_query.rb', line 135

def In(field, terms)
  Or.new(*terms.map { |term| Field.new(field, term) })
end

#Not(term) ⇒ Object



138
# File 'lib/lucene_query.rb', line 138

def Not(term) Not.new(term) end

#Or(*terms) ⇒ Object



134
# File 'lib/lucene_query.rb', line 134

def Or(*terms) Or.new(*terms) end

#Prohibit(term) ⇒ Object



140
# File 'lib/lucene_query.rb', line 140

def Prohibit(term) Prohibit.new(term) end

#Required(term) ⇒ Object



139
# File 'lib/lucene_query.rb', line 139

def Required(term) Required.new(term) end