Class: AzureSearch::IndexBatchOperation

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

Overview

Represents a batch operation in an indexing request.

Since:

  • 0.1.0

Direct Known Subclasses

IndexDeleteOperation, IndexUploadOperation

Class Method Summary collapse

Class Method Details

.delete(key_name, key_value) ⇒ Object

Encapsulates a delete request in an IndexDeleteOperation.

Parameters:

  • key_name (String)

    The key name.

  • key_value (String)

    The key value.

Since:

  • 0.1.0



19
20
21
# File 'lib/azure_search/index_batch_operation.rb', line 19

def self.delete(key_name, key_value)
  IndexDeleteOperation.new(key_name, key_value).to_hash
end

.upload(document) ⇒ Hash

Encapsulates the supplied document in an IndexUploadOperation.

Parameters:

  • document (Hash)

    The document.

Returns:

  • (Hash)

    The upload operation as a Hash.

Since:

  • 0.1.0



11
12
13
# File 'lib/azure_search/index_batch_operation.rb', line 11

def self.upload(document)
  IndexUploadOperation.new(document).to_hash
end