How does Amazon Elasticsearch Service & APIs Works?

Blog > How does Amazon Elasticsearch Service & APIs Works?

Amazon Elasticsearch Service & APIs

In the field of data science or Big Data, we heard a buzz about Elasticsearch. It allows its users to extract meaning from data at scale. Elasticsearch provides search query results back in milliseconds when other systems like Hadoop or apache-spark might take hours. Elastic search is a scalable version of the Lucene open-source search framework.

Elasticsearch is a potent tool, it’s not just for search. The low-level Elasticsearch is just about handling JSON requests. It’s using a powerful server that can process JSON requests and provide JSON data as a result. Here we are going to discuss how Amazon Elasticsearch and its APIs work.

Service Architecture

With the use of service, there is a need to deploy an Elasticsearch service domain. A domain wraps hardware and software to run an Elasticsearch Cluster. The user can deploy that domain again through the console SDK CLI or Cloudformation.

Elasticsearch Instances

The Elasticsearch instances within the service come in two flavors; there are data nodes and master nodes. Data nodes hold data and respond to updates and queries, and the master nodes are orchestrators of the cluster.

API Conventions

The Elasticsearch REST APIs are accessed using JSON over HTTP, so it’s a restful API that supports HTTP. Elasticsearch uses the following conventions throughout the REST API:

Multiple Indices

    • Most APIs support execution cross multiple indices
    • Different notations can use to perform operations in multiple indices such as:
      • Comma-separated notation: demo1, demo2, demo3
      • Wildcard notation (*, +, -): demo*, de*02, +demo3, -demo3, _all keyword for all indices
      • URL Query String Parameters:
1) ignore_unavailable
2) allow_no_indices
3) expand_wildcards

Data Math Support in Index Name

  • Elasticsearch allows to search indices according to date and time.
  • The user need to specify date and time in a specify format like:

<static_name {date_math_expr {date_format | time_zone}}>

Common Options

Following are the standard options for all the REST APIs:

  • Pretty Results
  • Human Readable Output
  • Date Math
  • Response Filtering
  • Flat Settings
  • Parameter
  • No Values
  • Time Units
  • Byte Size Units
  • Unitless Quantities
  • Distance Units
  • Fuzziness
  • Enabling Stack Traces
  • Request Body in Query String

URL Based Access Control

  • Users can also use a proxy with URL-based access control to secure access to the Elasticsearch indices.
  • The user has the option of specifying the index in the URL within the request body, such as:

(1) multi-search

(2) multi-get

(3) bulk

Types of Elasticsearch APIs

  • Document APIs
  • Aggregation APIs
  • Cluster APIs
  • Search APIs
  • Index APIs

Document API

Single Document API

  • Index API
  • Get API
  • Update API
  • Delete API

Multi-Document API

  • Multi- Get API
  • Bulk API
  • Delete by Query API
  • Update by Query API
  • Re-index API

Search API

The search API allows its users to execute a search query and get back search hits that match the query.

Multi-Index: The user can search for the documents present in all the indices or some specified indices.

Multi-Type: It allows to search all the documents in an index across all types or in some specified type.

URL Search: Various parameters can be passed in a search operation using, uniform resource identifier:

  • q
  • lenient
  • field
  • sort
  • timeout
  • terminate_after
  • from
  • size

Aggregation

The Aggregation API collects all the data which is selected by the search query. This framework consists of many building blocks called aggregators, which help build complex summaries of the data. Here are some types of Aggregation API:

  • Bucketing
  • Metric
  • Matrix
  • Pipeline

Index API

The index APIs are responsible for managing all the aspects of the index, such as settings, aliases, mappings, and index templates.

  • Create Index
  • Delete Index
  • Get Index
  • Index Exits
  • Open / Close Index API
  • Index Aliases
  • Index Settings
  • Analyze
  • Index Template
  • Index Stats
  • Flush
  • Refresh

Cluster API

The cluster API is helpful to get information about the cluster and its nodes and make changes in them.

  • Cluster Health
  • Cluster State
  • Pending Cluster Task
  • Cluster Reroute
  • Node Stats
  • Nodes hot_threads

 

Author: SVCIT Editorial

Copyright Silicon Valley Cloud IT, LLC.

Svcit Silicon Valley Cloud IT LLC. + 1 (855)-MYSVCIT Customers@SiliconValleyCloudIT.com