lib/elastic_search/query_builder.rb in elasticsearch-query-builder-0.1.7 vs lib/elastic_search/query_builder.rb in elasticsearch-query-builder-0.5
- old
+ new
@@ -18,10 +18,10 @@
sort: %i[sort],
aggs: [:aggs]
}.freeze
METHODS.each do |method, path|
define_method(method) do |body|
- return self if body.not_present?
+ return self if body.not_present? || (!@function_score && path.first == :functions)
internal_path = path
internal_path = %i[query function_score] + path if @function_score &&
%i[functions query].any?(path.first)