Module: Chewie::Interface::TermLevel

Included in:
Chewie
Defined in:
lib/chewie/interface/term_level.rb

Instance Method Summary collapse

Instance Method Details

#fuzzy(attribute, context: :query, clause: nil, options: {}) ⇒ Hash

Parameters:

Returns:

  • (Hash)

    A valid “fuzzy” query



11
12
13
14
15
16
17
18
19
20
# File 'lib/chewie/interface/term_level.rb', line 11

def fuzzy(attribute, context: :query, clause: nil, options: {})
  handler = {
    query: :fuzzy,
    clause: clause,
    attribute: attribute,
    query_type: :term_level,
    options: options,
  }
  set_handler(context: context, handler: handler)
end

#range(attribute, context: :query, clause: nil, options: {}) ⇒ Hash

Parameters:

Returns:

  • (Hash)

    A valid “range” query



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/chewie/interface/term_level.rb', line 29

def range(attribute, context: :query, clause: nil, options: {})
  handler = {
    query: :range,
    clause: clause,
    attribute: attribute,
    query_type: :term_level,
    options: options
  }

  set_handler(context: context, handler: handler)
end

#term(attribute, context: :query, clause: nil, options: {}) ⇒ Hash

Parameters:

Returns:

  • (Hash)

    A valid “term” query



48
49
50
51
52
53
54
55
56
57
58
# File 'lib/chewie/interface/term_level.rb', line 48

def term(attribute, context: :query, clause: nil, options: {})
  handler = {
    query: :term,
    clause: clause,
    attribute: attribute,
    query_type: :term_level,
    options: options
  }

  set_handler(context: context, handler: handler)
end

#terms(attribute, context: :query, clause: nil, options: {}) ⇒ Hash

Parameters:

Returns:

  • (Hash)

    A valid “terms” query



67
68
69
70
71
72
73
74
75
76
77
# File 'lib/chewie/interface/term_level.rb', line 67

def terms(attribute, context: :query, clause: nil, options: {})
  handler = {
    query: :terms,
    clause: clause,
    attribute: attribute,
    query_type: :term_level,
    options: options
  }

  set_handler(context: context, handler: handler)
end