lib/search_flip/criteria.rb in search_flip-4.0.0.beta13 vs lib/search_flip/criteria.rb in search_flip-4.0.0.beta14
- old
+ new
@@ -348,12 +348,12 @@
dupped_request.delete(:size)
http_request = connection.http_client
http_request = http_request.timeout(http_timeout_value) if http_timeout_value
- if connection.version.to_i >= 5
- url = connection.version.to_i < 8 ? target.type_url : target.index_url
+ if connection.distribution || connection.version.to_i >= 5
+ url = connection.distribution.nil? && connection.version.to_i < 8 ? target.type_url : target.index_url
http_request.post("#{url}/_delete_by_query", params: request_params.merge(params), json: dupped_request)
else
http_request.delete("#{target.type_url}/_query", params: request_params.merge(params), json: dupped_request)
end
@@ -620,18 +620,18 @@
"#{connection.base_url}/_search/scroll",
params: request_params,
json: { scroll: scroll_args[:timeout], scroll_id: scroll_args[:id] }
)
elsif scroll_args
- url = connection.version.to_i < 8 ? target.type_url : target.index_url
+ url = connection.distribution.nil? && connection.version.to_i < 8 ? target.type_url : target.index_url
http_request.post(
"#{url}/_search",
params: request_params.merge(scroll: scroll_args[:timeout]),
json: request
)
else
- url = connection.version.to_i < 8 ? target.type_url : target.index_url
+ url = connection.distribution.nil? && connection.version.to_i < 8 ? target.type_url : target.index_url
http_request.post("#{url}/_search", params: request_params, json: request)
end
SearchFlip::Response.new(self, SearchFlip::JSON.parse(http_response.to_s))