Class: EagleSearch::Interpreter::Query

Inherits:
Object
  • Object
show all
Defined in:
lib/eagle_search/interpreter/query.rb

Instance Method Summary collapse

Constructor Details

#initialize(index, query, options) ⇒ Query

Returns a new instance of Query.



3
4
5
6
7
# File 'lib/eagle_search/interpreter/query.rb', line 3

def initialize(index, query, options)
  @index = index
  @query = query
  @options = options
end

Instance Method Details

#payloadObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/eagle_search/interpreter/query.rb', line 9

def payload
  case @query
  when String
    if @query == "*"
      { match_all: {} }
    else
      query_payload
    end
  end
end