lib/elasticsearch/api/actions/exists.rb in elasticsearch-api-6.1.0 vs lib/elasticsearch/api/actions/exists.rb in elasticsearch-api-6.2.0

- old
+ new

@@ -28,36 +28,39 @@ # def exists(arguments={}) raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] arguments[:type] ||= UNDERSCORE_ALL - - valid_params = [ - :stored_fields, - :parent, - :preference, - :realtime, - :refresh, - :routing, - :_source, - :_source_exclude, - :_source_include, - :version, - :version_type ] - method = HTTP_HEAD path = Utils.__pathify Utils.__escape(arguments[:index]), Utils.__escape(arguments[:type]), Utils.__escape(arguments[:id]) - params = Utils.__validate_and_extract_params arguments, valid_params + params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil Utils.__rescue_from_not_found do perform_request(method, path, params, body).status == 200 ? true : false end end - alias_method :exists?, :exists + + # Register this action with its valid params when the module is loaded. + # + # @since 6.2.0 + ParamsRegistry.register(:exists, [ + :stored_fields, + :parent, + :preference, + :realtime, + :refresh, + :routing, + :_source, + :_source_exclude, + :_source_excludes, + :_source_include, + :_source_includes, + :version, + :version_type ].freeze) end end end