Module: ROM::Elasticsearch::QueryMethods
- Included in:
- Dataset
- Defined in:
- lib/rom/elasticsearch/query_methods.rb
Overview
Dataset's query methods
Instance Method Summary collapse
-
#get(id) ⇒ Dataset
Return a new dataset configured to search by :id.
-
#query(query) ⇒ Dataset
Return a new dataset configured to search via :query body option.
-
#query_string(expression) ⇒ Dataset
Return a new dataset configured to search via :query_string body option.
-
#search(options) ⇒ Dataset
Return a new dataset configured to search via new body options.
Instance Method Details
#get(id) ⇒ Dataset
Return a new dataset configured to search by :id
22 23 24 |
# File 'lib/rom/elasticsearch/query_methods.rb', line 22 def get(id) params(id: id) end |
#query(query) ⇒ Dataset
Return a new dataset configured to search via :query body option
61 62 63 |
# File 'lib/rom/elasticsearch/query_methods.rb', line 61 def query(query) body(query: query) end |
#query_string(expression) ⇒ Dataset
Return a new dataset configured to search via :query_string body option
48 49 50 |
# File 'lib/rom/elasticsearch/query_methods.rb', line 48 def query_string(expression) query(query_string: { query: expression }) end |
#search(options) ⇒ Dataset
Return a new dataset configured to search via new body options
35 36 37 |
# File 'lib/rom/elasticsearch/query_methods.rb', line 35 def search() body() end |