Class: Esearch::Command

Inherits:
Object
  • Object
show all
Includes:
AbstractType, Adamantium::Flat
Defined in:
lib/esearch/command.rb,
lib/esearch/command/exist.rb,
lib/esearch/command/index.rb,
lib/esearch/command/search.rb,
lib/esearch/command/status.rb,
lib/esearch/command/cluster.rb,
lib/esearch/command/document.rb

Overview

Abstract base class for elasticsearch commands

Direct Known Subclasses

Cluster, Document, Exist, Index, Search, Status

Defined Under Namespace

Classes: Cluster, Document, Exist, Index, Search, Status

Constant Summary collapse

EXPECTED_STATI =
[ 200 ].freeze
JSON_CONTENT_TYPE =
'application/json; charset=UTF-8'.freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.run(*args) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Run command

Returns:

  • (Object)


15
16
17
# File 'lib/esearch/command.rb', line 15

def self.run(*args)
  new(*args).result
end

Instance Method Details

#resultPresenter

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return result of request

Returns:



25
26
27
28
# File 'lib/esearch/command.rb', line 25

def result
  assert_success
  presenter.new(parsed_json)
end