Module: Elos::QueryBuilder::Queries

Extended by:
ActiveSupport::Concern
Included in:
Base
Defined in:
lib/elos/query_builder/queries.rb

Instance Method Summary collapse

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_queryObject



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