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/mlt.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/actions/suggest.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/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/percolate.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/mpercolate.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/field_stats.rb,
lib/elasticsearch/api/actions/indices/get.rb,
lib/elasticsearch/api/actions/nodes/stats.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/get_template.rb,
lib/elasticsearch/api/actions/indices/open.rb,
lib/elasticsearch/api/actions/indices/seal.rb,
lib/elasticsearch/api/actions/mtermvectors.rb,
lib/elasticsearch/api/actions/put_template.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/indices/close.rb,
lib/elasticsearch/api/actions/indices/flush.rb,
lib/elasticsearch/api/actions/indices/stats.rb,
lib/elasticsearch/api/actions/search_exists.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/shrink.rb,
lib/elasticsearch/api/actions/indices/status.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/count_percolate.rb,
lib/elasticsearch/api/actions/delete_by_query.rb,
lib/elasticsearch/api/actions/delete_template.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/list_benchmarks.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/optimize.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/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/indices/forcemerge.rb,
lib/elasticsearch/api/actions/indices/get_warmer.rb,
lib/elasticsearch/api/actions/indices/put_warmer.rb,
lib/elasticsearch/api/actions/indices/clear_cache.rb,
lib/elasticsearch/api/actions/indices/exists_type.rb,
lib/elasticsearch/api/actions/indices/get_aliases.rb,
lib/elasticsearch/api/actions/indices/get_mapping.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/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/indices/delete_warmer.rb,
lib/elasticsearch/api/actions/indices/delete_mapping.rb,
lib/elasticsearch/api/actions/indices/snapshot_index.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/render_search_template.rb,
lib/elasticsearch/api/actions/indices/delete_template.rb,
lib/elasticsearch/api/actions/indices/exists_template.rb,
lib/elasticsearch/api/actions/snapshot/get_repository.rb,
lib/elasticsearch/api/actions/indices/get_field_mapping.rb,
lib/elasticsearch/api/actions/cluster/allocation_explain.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

Defined Under Namespace

Modules: Actions, Cat, Cluster, Common, Indices, Ingest, Nodes, 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
]
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
VERSION =
"5.0.4"

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Auto-include all namespaces in the receiver


42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/elasticsearch/api.rb', line 42

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
end

.serializerObject

The serializer class


57
58
59
# File 'lib/elasticsearch/api.rb', line 57

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

.settingsObject

Access the module settings


63
64
65
# File 'lib/elasticsearch/api.rb', line 63

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