Would you like to learn how to create an Index on Elasticsearch? In this tutorial, we are going to show you how to create a new Index on the ElasticSearch server on a computer running Ubuntu Linux.

• Ubuntu 18
• Ubuntu 19
• ElasticSearch 7.6.2

In our example, The ElastiSearch server IP address is 192.168.100.7.

Important! The Elasticsearch uses the word Index instead of the word Table.

Tutorial ElasticSearch – Creating an Index

Install the required packages.

Copy to Clipboard

Test your communication with the ElasticSearch server.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

Create an ElasticSearch index named ACCOUNTS.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

Add the following fields:

• Username – Text
• Name – Text
• Email – Text
• Age – Numeric

Copy to Clipboard

Here is the command output:

Copy to Clipboard

Verify the mapping configuration.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

Congratulations! You have created a new Index on the ElasticSearch server.

Tutorial ElasticSearch – Adding information to an Index

Add an entry to the ElasticSearch Index.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

Add another entry to the ElasticSearch Index.

Copy to Clipboard

List all entries on the Index.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

List all entries on the Index containing the word Bruno.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

List all entries on the Index with an age of less than 40.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

Congratulations! You are able to add entries to an ElasticSearch Index.