Class: AgnosticBackend::Queryable::Elasticsearch::Executor
Instance Attribute Summary
#options, #query, #visitor
Instance Method Summary
collapse
Methods included from Utilities
included
#initialize
Instance Method Details
#execute ⇒ Object
7
8
9
10
11
12
13
14
|
# File 'lib/agnostic_backend/queryable/elasticsearch/executor.rb', line 7
def execute
if scroll_cursor.present?
response = client.send_request(:post, path: "_search/scroll", body: params)
else
response = client.send_request(:post, path: "#{index.index_name}/#{index.type}/_search", body: params)
end
ResultSet.new(ActiveSupport::JSON.decode(response.body), query)
end
|
#params ⇒ Object
20
21
22
|
# File 'lib/agnostic_backend/queryable/elasticsearch/executor.rb', line 20
def params
scroll_cursor.present? ? scroll_cursor : query.accept(visitor)
end
|
#to_s ⇒ Object
16
17
18
|
# File 'lib/agnostic_backend/queryable/elasticsearch/executor.rb', line 16
def to_s
params
end
|