Method: Elasticquery::Query#initialize

Defined in:
lib/elasticquery/query.rb

#initialize(query = DEFAULT) ⇒ Query

Create new query from hash.

Examples:

Elasticsearch::Query.new.to_hash #=> {query: {filtered: {query: {match_all:{}}}}}

Parameters:

  • query (Hash) (defaults to: DEFAULT)

    passed as hash. When it not passed use default es ‘match_all’ query



16
17
18
19
# File 'lib/elasticquery/query.rb', line 16

def initialize(query = DEFAULT)
  @query = query
  @filters = []
end