lib/elasticsearch/api/actions/clear_scroll.rb in elasticsearch-api-8.7.1 vs lib/elasticsearch/api/actions/clear_scroll.rb in elasticsearch-api-8.8.0

- old
+ new

@@ -13,11 +13,11 @@ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash cf0d0c8ed43ab23b6d73c430a66aca4e771fce20 +# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 # @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec # module Elasticsearch module API module Actions @@ -30,11 +30,11 @@ # *Deprecation notice*: # A scroll id can be quite large and should be specified as part of the body # Deprecated since version 7.0.0 # # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.7/clear-scroll-api.html + # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.8/clear-scroll-api.html # def clear_scroll(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} @@ -46,14 +46,22 @@ path = if _scroll_id "_search/scroll/#{Utils.__listify(_scroll_id)}" else "_search/scroll" end - params = {} + params = Utils.process_params(arguments) - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers) - ) + if Array(arguments[:ignore]).include?(404) + Utils.__rescue_from_not_found { + Elasticsearch::API::Response.new( + perform_request(method, path, params, body, headers) + ) + } + else + Elasticsearch::API::Response.new( + perform_request(method, path, params, body, headers) + ) + end end end end end