Module: Elasticsearch::API

Defined in:
lib/elasticsearch/api.rb,
lib/elasticsearch/api/utils.rb,
lib/elasticsearch/api/version.rb,
lib/elasticsearch/api/actions/get.rb,
lib/elasticsearch/api/actions/bulk.rb,
lib/elasticsearch/api/actions/info.rb,
lib/elasticsearch/api/actions/mget.rb,
lib/elasticsearch/api/actions/ping.rb,
lib/elasticsearch/api/actions/count.rb,
lib/elasticsearch/api/actions/index.rb,
lib/elasticsearch/api/namespace/cat.rb,
lib/elasticsearch/api/actions/create.rb,
lib/elasticsearch/api/actions/delete.rb,
lib/elasticsearch/api/actions/exists.rb,
lib/elasticsearch/api/actions/scroll.rb,
lib/elasticsearch/api/actions/search.rb,
lib/elasticsearch/api/actions/update.rb,
lib/elasticsearch/api/actions/explain.rb,
lib/elasticsearch/api/actions/msearch.rb,
lib/elasticsearch/api/actions/reindex.rb,
lib/elasticsearch/api/namespace/nodes.rb,
lib/elasticsearch/api/namespace/tasks.rb,
lib/elasticsearch/api/actions/cat/help.rb,
lib/elasticsearch/api/namespace/common.rb,
lib/elasticsearch/api/namespace/ingest.rb,
lib/elasticsearch/api/namespace/remote.rb,
lib/elasticsearch/api/actions/benchmark.rb,
lib/elasticsearch/api/actions/cat/count.rb,
lib/elasticsearch/api/actions/cat/nodes.rb,
lib/elasticsearch/api/actions/cat/tasks.rb,
lib/elasticsearch/api/actions/rank_eval.rb,
lib/elasticsearch/api/actions/tasks/get.rb,
lib/elasticsearch/api/namespace/cluster.rb,
lib/elasticsearch/api/namespace/indices.rb,
lib/elasticsearch/api/actions/cat/health.rb,
lib/elasticsearch/api/actions/cat/master.rb,
lib/elasticsearch/api/actions/cat/shards.rb,
lib/elasticsearch/api/actions/field_caps.rb,
lib/elasticsearch/api/actions/get_script.rb,
lib/elasticsearch/api/actions/get_source.rb,
lib/elasticsearch/api/actions/nodes/info.rb,
lib/elasticsearch/api/actions/put_script.rb,
lib/elasticsearch/api/actions/tasks/list.rb,
lib/elasticsearch/api/namespace/snapshot.rb,
lib/elasticsearch/api/actions/cat/aliases.rb,
lib/elasticsearch/api/actions/cat/indices.rb,
lib/elasticsearch/api/actions/cat/plugins.rb,
lib/elasticsearch/api/actions/indices/get.rb,
lib/elasticsearch/api/actions/nodes/stats.rb,
lib/elasticsearch/api/actions/nodes/usage.rb,
lib/elasticsearch/api/actions/remote/info.rb,
lib/elasticsearch/api/actions/termvectors.rb,
lib/elasticsearch/api/actions/cat/recovery.rb,
lib/elasticsearch/api/actions/cat/segments.rb,
lib/elasticsearch/api/actions/clear_scroll.rb,
lib/elasticsearch/api/actions/indices/open.rb,
lib/elasticsearch/api/actions/mtermvectors.rb,
lib/elasticsearch/api/actions/snapshot/get.rb,
lib/elasticsearch/api/actions/tasks/cancel.rb,
lib/elasticsearch/api/actions/cat/fielddata.rb,
lib/elasticsearch/api/actions/cat/nodeattrs.rb,
lib/elasticsearch/api/actions/cat/snapshots.rb,
lib/elasticsearch/api/actions/cat/templates.rb,
lib/elasticsearch/api/actions/cluster/state.rb,
lib/elasticsearch/api/actions/cluster/stats.rb,
lib/elasticsearch/api/actions/delete_script.rb,
lib/elasticsearch/api/actions/exists_source.rb,
lib/elasticsearch/api/actions/indices/clone.rb,
lib/elasticsearch/api/actions/indices/close.rb,
lib/elasticsearch/api/actions/indices/flush.rb,
lib/elasticsearch/api/actions/indices/split.rb,
lib/elasticsearch/api/actions/indices/stats.rb,
lib/elasticsearch/api/actions/search_shards.rb,
lib/elasticsearch/api/actions/cat/allocation.rb,
lib/elasticsearch/api/actions/cluster/health.rb,
lib/elasticsearch/api/actions/indices/create.rb,
lib/elasticsearch/api/actions/indices/delete.rb,
lib/elasticsearch/api/actions/indices/exists.rb,
lib/elasticsearch/api/actions/indices/freeze.rb,
lib/elasticsearch/api/actions/indices/shrink.rb,
lib/elasticsearch/api/actions/nodes/shutdown.rb,
lib/elasticsearch/api/actions/abort_benchmark.rb,
lib/elasticsearch/api/actions/cat/thread_pool.rb,
lib/elasticsearch/api/actions/cluster/reroute.rb,
lib/elasticsearch/api/actions/delete_by_query.rb,
lib/elasticsearch/api/actions/indices/analyze.rb,
lib/elasticsearch/api/actions/indices/refresh.rb,
lib/elasticsearch/api/actions/indices/upgrade.rb,
lib/elasticsearch/api/actions/ingest/simulate.rb,
lib/elasticsearch/api/actions/params_registry.rb,
lib/elasticsearch/api/actions/search_template.rb,
lib/elasticsearch/api/actions/snapshot/create.rb,
lib/elasticsearch/api/actions/snapshot/delete.rb,
lib/elasticsearch/api/actions/snapshot/status.rb,
lib/elasticsearch/api/actions/update_by_query.rb,
lib/elasticsearch/api/actions/cat/repositories.rb,
lib/elasticsearch/api/actions/indices/recovery.rb,
lib/elasticsearch/api/actions/indices/rollover.rb,
lib/elasticsearch/api/actions/indices/segments.rb,
lib/elasticsearch/api/actions/indices/unfreeze.rb,
lib/elasticsearch/api/actions/msearch_template.rb,
lib/elasticsearch/api/actions/snapshot/restore.rb,
lib/elasticsearch/api/actions/cat/pending_tasks.rb,
lib/elasticsearch/api/actions/indices/get_alias.rb,
lib/elasticsearch/api/actions/indices/put_alias.rb,
lib/elasticsearch/api/actions/nodes/hot_threads.rb,
lib/elasticsearch/api/actions/get_script_context.rb,
lib/elasticsearch/api/actions/indices/forcemerge.rb,
lib/elasticsearch/api/actions/reindex_rethrottle.rb,
lib/elasticsearch/api/actions/cat/params_registry.rb,
lib/elasticsearch/api/actions/cluster/remote_info.rb,
lib/elasticsearch/api/actions/indices/clear_cache.rb,
lib/elasticsearch/api/actions/indices/exists_type.rb,
lib/elasticsearch/api/actions/indices/get_mapping.rb,
lib/elasticsearch/api/actions/indices/get_upgrade.rb,
lib/elasticsearch/api/actions/indices/put_mapping.rb,
lib/elasticsearch/api/actions/ingest/get_pipeline.rb,
lib/elasticsearch/api/actions/ingest/put_pipeline.rb,
lib/elasticsearch/api/actions/cluster/get_settings.rb,
lib/elasticsearch/api/actions/cluster/put_settings.rb,
lib/elasticsearch/api/actions/delete_by_rethrottle.rb,
lib/elasticsearch/api/actions/get_script_languages.rb,
lib/elasticsearch/api/actions/indices/delete_alias.rb,
lib/elasticsearch/api/actions/indices/exists_alias.rb,
lib/elasticsearch/api/actions/indices/flush_synced.rb,
lib/elasticsearch/api/actions/indices/get_settings.rb,
lib/elasticsearch/api/actions/indices/get_template.rb,
lib/elasticsearch/api/actions/indices/put_settings.rb,
lib/elasticsearch/api/actions/indices/put_template.rb,
lib/elasticsearch/api/actions/indices/shard_stores.rb,
lib/elasticsearch/api/actions/cluster/pending_tasks.rb,
lib/elasticsearch/api/actions/ingest/processor_grok.rb,
lib/elasticsearch/api/actions/nodes/params_registry.rb,
lib/elasticsearch/api/actions/tasks/params_registry.rb,
lib/elasticsearch/api/actions/indices/update_aliases.rb,
lib/elasticsearch/api/actions/indices/validate_query.rb,
lib/elasticsearch/api/actions/ingest/delete_pipeline.rb,
lib/elasticsearch/api/actions/ingest/params_registry.rb,
lib/elasticsearch/api/actions/render_search_template.rb,
lib/elasticsearch/api/actions/cluster/params_registry.rb,
lib/elasticsearch/api/actions/indices/delete_template.rb,
lib/elasticsearch/api/actions/indices/exists_template.rb,
lib/elasticsearch/api/actions/indices/params_registry.rb,
lib/elasticsearch/api/actions/snapshot/get_repository.rb,
lib/elasticsearch/api/actions/scripts_painless_execute.rb,
lib/elasticsearch/api/actions/snapshot/params_registry.rb,
lib/elasticsearch/api/actions/indices/get_field_mapping.rb,
lib/elasticsearch/api/actions/cluster/allocation_explain.rb,
lib/elasticsearch/api/actions/delete_by_query_rethrottle.rb,
lib/elasticsearch/api/actions/snapshot/create_repository.rb,
lib/elasticsearch/api/actions/snapshot/delete_repository.rb,
lib/elasticsearch/api/actions/snapshot/verify_repository.rb,
lib/elasticsearch/api/actions/update_by_query_rethrottle.rb,
lib/elasticsearch/api/actions/snapshot/cleanup_repository.rb,
lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb

Defined Under Namespace

Modules: Actions, Cat, Cluster, Common, Indices, Ingest, Nodes, Remote, Snapshot, Tasks, Utils

Constant Summary collapse

DEFAULT_SERIALIZER =
MultiJson
COMMON_PARAMS =
[
  :ignore,                        # Client specific parameters
  :index, :type, :id,             # :index/:type/:id
  :body,                          # Request body
  :node_id,                       # Cluster
  :name,                          # Alias, template, settings, warmer, ...
  :field                          # Get field mapping
]
COMMON_QUERY_PARAMS =
[
  :ignore,                        # Client specific parameters
  :format,                        # Search, Cat, ...
  :pretty,                        # Pretty-print the response
  :human,                         # Return numeric values in human readable format
  :filter_path,                   # Filter the JSON response
  :opaque_id                      # Use X-Opaque-Id
]
HTTP_GET =
'GET'.freeze
HTTP_HEAD =
'HEAD'.freeze
HTTP_POST =
'POST'.freeze
HTTP_PUT =
'PUT'.freeze
HTTP_DELETE =
'DELETE'.freeze
UNDERSCORE_SEARCH =
'_search'.freeze
UNDERSCORE_ALL =
'_all'.freeze
DEFAULT_DOC =
'_doc'.freeze
VERSION =
"7.6.0"

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Auto-include all namespaces in the receiver



50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/elasticsearch/api.rb', line 50

def self.included(base)
  base.send :include,
            Elasticsearch::API::Common,
            Elasticsearch::API::Actions,
            Elasticsearch::API::Cluster,
            Elasticsearch::API::Nodes,
            Elasticsearch::API::Indices,
            Elasticsearch::API::Ingest,
            Elasticsearch::API::Snapshot,
            Elasticsearch::API::Tasks,
            Elasticsearch::API::Cat,
            Elasticsearch::API::Remote
end

.serializerObject

The serializer class



66
67
68
# File 'lib/elasticsearch/api.rb', line 66

def self.serializer
  settings[:serializer] || DEFAULT_SERIALIZER
end

.settingsObject

Access the module settings



72
73
74
# File 'lib/elasticsearch/api.rb', line 72

def self.settings
  @settings ||= {}
end