0
0
Elasticsearchquery~30 mins

Creating an index in Elasticsearch - Try It Yourself

Choose your learning style9 modes available
Creating an index
📖 Scenario: You are setting up a simple search system for a small library. You want to create a place to store book information so you can find books easily later.
🎯 Goal: Create an Elasticsearch index called library with basic settings and mappings to store book titles and authors.
📋 What You'll Learn
Create an index named library
Add settings with number_of_shards set to 1
Add mappings for title and author fields as text
💡 Why This Matters
🌍 Real World
Creating an index is the first step in storing and searching data efficiently in Elasticsearch, useful for search engines, catalogs, and logs.
💼 Career
Knowing how to create and configure indexes is essential for roles like data engineer, backend developer, and search specialist working with Elasticsearch.
Progress0 / 4 steps
1
Create the index name
Write a JSON object to create an index named library with empty settings and mappings objects.
Elasticsearch
Need a hint?

Start by naming the index library and add empty settings and mappings objects.

2
Add index settings
Add a settings object with number_of_shards set to 1 inside the index creation JSON.
Elasticsearch
Need a hint?

Inside settings, set "number_of_shards" to 1 to keep it simple.

3
Add mappings for book fields
Add a mappings object with properties defining title and author fields as text type.
Elasticsearch
Need a hint?

Inside mappings, add properties with title and author as text fields.

4
Complete the index creation JSON
Ensure the JSON object includes settings with number_of_shards set to 1, and mappings with title and author as text fields.
Elasticsearch
Need a hint?

Double-check that all parts are included: settings, and mappings with correct fields.