AWS Elasticsearch Tutorial

AWS Elasticsearch is a service that allows you to deploy, scale and operate Elasticsearch on the AWS cloud. If you have a solid understanding of Elasticsearch concepts, you will be ready to start using it. It is important to be able to identify the best approach steps to make sure you do the job efficiently.
This tutorial will help you understand how to create and configure an Elasticsearch domain using Amazon’s dedicated service. These steps will give you a clear understanding of how to quickly get your domain online. Follow this tutorial until the end!
Recommendation: To learn more, read our previous article “What Is AWS Elasticsearch?”
Amazon Elasticsearch Service: Creating a Domain
Amazon ES (Elasticsearch Domain) is synonymous with Elasticsearch cluster. Domains are clusters that have settings, instance counts and storage resources. Instance types can be specified by you. You can create your Amazon Elasticsearch Service Domain using the dedicated console, AWS SDKs, or AWS CLI. These are the steps to create an Amazon Elasticsearch Service domain.
Visit the official website for AWS services and click ‘Sign In to Console’.
Select the tab ‘Analytics’ and select the option ‘Elasticsearch Services’
Go ahead and click the tab, “Create a new website.”
Select the tab Development or Testing’ to choose the type you prefer.
Click on “Next” to select the latest Elasticsearch version.
Give your domain a name.
You can ignore the “custom endpoint” setting.
Move ahead to the ‘Data Nodes’ section and select instance type as ‘t3.small.elasticsearch’ with a default value for one node.
You can now choose Next to save all settings.
It is preferable to use a public domain by selecting “Public Access” under “Network Configuration.”
You can use the “Create master account” option to implement access control.
You will then be confronted with Amazon Cognito and SAML authentication. These can be ignored for now.
You will need to select “Allow Open Access to Domain” under the “Domain Access Policy”.
You should set the encryption settings to default and then click on “Next.”
You can ignore the settings of the tag and click on “Next.”
Now confirm the domain configuration and click ‘Confirm’ to confirm. The domain will begin initializing in 10 to 15 minutes. It may take longer depending on the configurations you have selected.
After the domain has been created, you should note its endpoint.
Uploading Data to Amazon Elasticsearch Service For Indexing Purpose
After creating your domain, you can upload data to it using any programming language or command line. Any of the HTTP tools included in the Amazon ES Service can be used. You can use Postman, curl, or dev console to upload data. These are the steps to help you master the process for uploading data into Amazon ES to fulfill your indexing needs.
Indexing the Document

To add a single document to an Amazon ES Service domain, you will need to execute a specific command. No matter which HTTP tool you are using, you must make the HTTP call to create an index within a new file. Here is an example HTTP call:
PUT /vegetables/_doc/1″name”:”carrot”,”color”:”orange”
This example shows that you are using Kibana’s dev console as your HTTP tool. You will need to adapt URLs and credentials to other tools you use. After calling the endpoint, it creates an Index and places a single document in the Index ID 1. In this example, the Index has been named “vegetables”.
This example of index creation calls uses the _doc part to indicate the type of document. It is recommended that you create an index to each type of document. It is only possible if you create an Amazon Elasticsearch Service ID for each type of document.
Auto-generated IDs

You can use the command POST instead PUT to create the Amazon Elasticsearch Service ID.
POST /veggies/_doc”name”:”beet”,”color”:”red”,”classification”:”root”
This call creates an index with the name “veggies” and adds the document to it. It creates an ID for your document, which will eliminate the need to add any number ID to the call. This is because you have already created a document using the system-generated ID. You are not required to provide one.
Update Document with POST

You can request an update for an exis by using the HTTP POST command with an identifier