lib/aws_cloud_search/document_batch.rb
# Adds a document with the add operation to the batch.
# @param [Document] doc
# @raise [ArgumentError] If parameter is not an AWSCloudSearch::Document
Adds a document with the add operation to the batch.
Adds a document with the add operation to the batch .
def add_document(doc)
      raise ArgumentError.new("Invalid Type") unless doc.is_a? Document
      doc.type = 'add'
      json = doc.to_json
      doc_bytesize = json.bytesize
      raise Exception.new("Max batch size exceeded, document add was not added to batch.") if (doc_bytesize + @bytesize) > @max_bytesize
      raise ArgumentError.new("Found invalid XML 1.0 unicode characters.") if json =~ INVALID_CHAR_XML10
      @bytesize += doc_bytesize
      @batch_add << doc
    end
def add_document ( doc ) raise ArgumentError . new ( "Invalid Type" ) unless doc . is_a? Document doc . type = 'add' json = doc . to_json doc_bytesize = json . bytesize raise Exception . new ( "Max batch size exceeded, document add was not added to batch." ) if ( doc_bytesize + @bytesize ) > @max_bytesize raise ArgumentError . new ( "Found invalid XML 1.0 unicode characters." ) if json =~ INVALID_CHAR_XML10 @bytesize += doc_bytesize @batch_add << doc end
Adds a document with the add operation to the batch.
Adds a document with the add operation to the batch .
[ArgumentError] If parameter is not an AWSCloudSearch::Document
[ ArgumentError ] If parameter is not an AWSCloudSearch :: Document
doc
<not_specific>
<not_specific>
None