Class: Arelastic::Builders::Query

Inherits:
Struct
  • Object
show all
Defined in:
lib/arelastic/builders/query.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



3
4
5
# File 'lib/arelastic/builders/query.rb', line 3

def name
  @name
end

Class Method Details

.[](field) ⇒ Object



5
6
7
# File 'lib/arelastic/builders/query.rb', line 5

def [](field)
  new(field)
end

.constant_score(search) ⇒ Object



9
10
11
# File 'lib/arelastic/builders/query.rb', line 9

def constant_score(search)
  query Arelastic::Queries::ConstantScore.new(search)
end

.filtered(query: nil, filter: nil) ⇒ Object



13
14
15
# File 'lib/arelastic/builders/query.rb', line 13

def filtered(query: nil, filter: nil)
  query Arelastic::Queries::Filtered.new(query: query, filter: filter)
end

.match_allObject



17
18
19
# File 'lib/arelastic/builders/query.rb', line 17

def match_all
  query Arelastic::Queries::MatchAll.new
end

.multi_match(query, fields, options = {}) ⇒ Object



21
22
23
# File 'lib/arelastic/builders/query.rb', line 21

def multi_match(query, fields, options = {})
  query Arelastic::Queries::MultiMatch.new query, fields, options
end

Instance Method Details

#field(other) ⇒ Object



31
32
33
# File 'lib/arelastic/builders/query.rb', line 31

def field other
  Arelastic::Queries::Field.new name, other
end

#match(other) ⇒ Object



43
44
45
# File 'lib/arelastic/builders/query.rb', line 43

def match other
  Arelastic::Queries::Match.new name, other
end

#term(other) ⇒ Object



35
36
37
# File 'lib/arelastic/builders/query.rb', line 35

def term other
  Arelastic::Queries::Term.new name, other
end

#terms(other) ⇒ Object



39
40
41
# File 'lib/arelastic/builders/query.rb', line 39

def terms other
  Arelastic::Queries::Terms.new name, other
end