Method: Queries::BoolQueryBuilder#query

Defined in:
lib/queries/bool_query_builder.rb

#queryHash

Returns serialized query hash for this object

Returns:

  • (Hash)

    returns serialized query hash for this object



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/queries/bool_query_builder.rb', line 31

def query
  query = {}
  bool_query = common_query
  bool_query[:should] = @should_queries.map(&:query)
  bool_query[:must] = @must_queries.map(&:query)
  bool_query[:must_not] = @mustnot_queries.map(&:query)
  bool_query[:filter] = @filter_queries.map(&:query)
  bool_query[:minimum_should_match] = @minimum_should_match
  bool_query[:boost] = @boost
  query[name.intern] = bool_query.compact
  query
end