Module: Elos::QueryBuilder::Queries
Instance Method Summary collapse
- #ids_query(key = :id, value = nil) ⇒ Object
- #match_all_query ⇒ Object
- #match_query(key, value) ⇒ Object
Instance Method Details
#ids_query(key = :id, value = nil) ⇒ Object
4 5 6 |
# File 'lib/elos/query_builder/queries.rb', line 4 def ids_query(key = :id, value = nil) { query: { ids: { values: value || params[key] } } } end |
#match_all_query ⇒ Object
12 13 14 |
# File 'lib/elos/query_builder/queries.rb', line 12 def match_all_query { query: { match_all: {} } } end |
#match_query(key, value) ⇒ Object
8 9 10 |
# File 'lib/elos/query_builder/queries.rb', line 8 def match_query(key, value) { query: { match: { key => { query: value, operator: 'and' } } } } end |