lib/esse/index/documents.rb in esse-0.3.4 vs lib/esse/index/documents.rb in esse-0.3.5

- old
+ new

@@ -234,9 +234,23 @@ end end count end + # Update documents by query + # + # @param options [Hash] Hash of paramenters that will be passed along to elasticsearch request + # @option [String, nil] :suffix The index suffix. Defaults to the nil. + # + # @return [Hash] The elasticsearch response hash + def update_by_query(suffix: nil, **options) + definition = { + index: index_name(suffix: suffix), + }.merge(options) + cluster.may_update_type!(definition) + cluster.api.update_by_query(**definition) + end + protected def document?(doc) Esse.document?(doc) end