Class: AzureSearch::IndexUploadOperation

Inherits:
IndexBatchOperation show all
Defined in:
lib/azure_search/index_batch_operation.rb

Overview

Represents an upload operation of a document.

Since:

  • 0.1.0

Instance Method Summary collapse

Methods inherited from IndexBatchOperation

delete, upload

Constructor Details

#initialize(document) ⇒ IndexUploadOperation

Returns a new instance of IndexUploadOperation.

Since:

  • 0.1.0



28
29
30
# File 'lib/azure_search/index_batch_operation.rb', line 28

def initialize(document)
  @document = document
end

Instance Method Details

#to_hashHash

Returns the upload operation as a Hash.

Returns:

  • (Hash)

    The upload operation.

Since:

  • 0.1.0



35
36
37
38
# File 'lib/azure_search/index_batch_operation.rb', line 35

def to_hash
  @document["@search.action"] = "upload"
  @document
end