lib/elasticsearch/api/actions/bulk.rb in elasticsearch-api-1.0.13 vs lib/elasticsearch/api/actions/bulk.rb in elasticsearch-api-1.0.14
- old
+ new
@@ -50,24 +50,31 @@
# @option arguments [String] :consistency Explicit write consistency setting for the operation
# (options: one, quorum, all)
# @option arguments [Boolean] :refresh Refresh the index after performing the operation
# @option arguments [String] :replication Explicitly set the replication type (options: sync, async)
# @option arguments [Time] :timeout Explicit operation timeout
+ # @option arguments [String] :fields Default comma-separated list of fields to return
+ # in the response for updates
#
# @return [Hash] Deserialized Elasticsearch response
#
# @see http://elasticsearch.org/guide/reference/api/bulk/
#
def bulk(arguments={})
+ arguments = arguments.clone
+
+ type = arguments.delete(:type)
+
valid_params = [
:consistency,
:refresh,
:replication,
:type,
- :timeout ]
+ :timeout,
+ :fields ]
method = HTTP_POST
- path = Utils.__pathify Utils.__escape(arguments[:index]), Utils.__escape(arguments[:type]), '_bulk'
+ path = Utils.__pathify Utils.__escape(arguments[:index]), Utils.__escape(type), '_bulk'
params = Utils.__validate_and_extract_params arguments, valid_params
body = arguments[:body]
if body.is_a? Array