Elasticsearch Index settings and Mappings: How to create Index mapping and settings (Elasticsearch and Kibana Devtool)

For illustration purpose we generally index document and elasticsearch(ELS) does settings and mappings creation for us. But in production environment we generally first create Index's settings and mapping. In ELS mapping has significance however in ELS 7 mapping will be irrelevant as Type will be decommissioned.
In this post we will see how to create Index settings and mapping in strict mode before creating very first document. Settings node primarily specify number of shards & number of replica. Mapping specify data types of document and analyzers details.

What is strict mode mapping ?
By default elasticsearch allows incremental change in document with new fields other than fields specified initially while setting up mapping node. i.e: "dynamic" : "false". Elasticsearch figure out data type dynamically and add it in mapping node.
In order to restrict specific set of fields in doc specified in mapping, we have to use
"dynamic" : "strict". Below PUT command creates mapping with dynamic = strict (highlighted in yellow)
ELS has two values for dynamic field.
dynamic : false - indexing field will be ignored
dynamic : strict  - indexing field will throw error

Create Index mapping and settings : Below PUT command creates index customers with settings and mapping details. By default ELS setup number of shards = 5, we have overwritten it to 2.
In mapping nodes we have to specify list of fields and analyzer details(fields where we want analysis to be carried out). name is of type text and we instruct to use standard analyzer for it.
Note:- When we have to use custom analyzer for analysis, custom analyzer is declared under settings node.

PUT /customers
{
  "settings": {
    "number_of_shards": 2,
    "number_of_replicas": 1
  },
  "mappings": {
    "online" :{
      "dynamic": "strict",
      "properties":{
        "gender" :{
          "type": "text",
          "analyzer" : "standard"
        },
        "age":{
            "type": "integer"
        },
        "total_spent":{
           "type": "float"
        },
        "is_new":{
           "type" : "boolean"
        },
        "name":{
           "type": "text",
           "analyzer" : "standard"
        },
        "address": {
          "type" : "text",
          "fields":{
            "keyword":{
              "type" : "keyword",
              "ignore_above":  256
            }
          }
        }
      }
    }
  }
}
Show response

Index customers document of type Online: Index document successfully as it followed mapping specs (all document fields are specified in mapping)
PUT /customers/online/176
{  
        "gender" : "male",
        "age":25,
        "total_spent":1298.69,
        "is_new":false,
        "name": "Nikhil",
        "address" : "Windsor prime, Bangalore"
}
Show response

Index customers document with additional fields : Here we will add locale field in document and expect elastic search will not index document successfully, it should throw error - strict_dynamic_mapping_exception. Remember "dynamic" : "strict" will enforce indexing to follow mapping specs.
PUT /customers/online/176
{  
        "gender" : "male",
        "age":25,
        "total_spent":1298.69,
        "is_new":false,
        "name": "Nikhil",
        "address" : "Windsor prime, Bangalore",
        "locale" : "en-US"
}
Show response

How to add restriction on existing index type ? Using _mapping with PUT command we can change dynamic value of a given type.
PUT /customers/_mapping/online
{
    "dynamic": "strict"
}
Show response

36 Comments

  1. Great blog thanks for sharing Instagram and Facebook have provided an amazing place for new brands to grow and flourish. We can find the perfect niche for your brand on the best social media platforms. Marketing through social media brings forth global audience without all these physical boundaries. Analyze and take over the competition with ease with Adhuntt Media’s digital marketing tools and strategies.
    digital marketing company in chennai

    ReplyDelete
  2. Nice blog thanks for sharing You have come to the right place. Karuna Nursery Gardens is the ideal place to begin your journey into landscape gardening. Our specialists have built some of the finest landscape garden in Chennai that too at the best price and amazing service.
    plant nursery in chennai

    ReplyDelete
  3. Excellent blog thanks for sharing Looking for the best place in Chennai to get your cosmetics at wholesale? The Pixies Beauty Shop is the premium wholesale cosmetics shop in Chennai that has all the international brands your salon deserves.
    beauty Shop in Chennai

    ReplyDelete
  4. Amazing post, thanks for publishing!

    ReplyDelete
  5. python interview questions and answers for testers


    Important Python Interview Questions and Answers for freshers and experienced to get your dream job in Python! 101 Python Basic Interview Questions for Freshers

    ReplyDelete
  6. I read your post and got it quite informative. I couldn't find any knowledge on this matter prior to. I would like to thanks for sharing this article here.African Cosmetics Online Shop

    ReplyDelete
  7. Thanks for this great post! I am using your article for my reference. Keep sharing more such valuable articles.
    HTML5 course
    HTML course
    PHP Training in Velachery
    Software Testing Training in Velachery

    ReplyDelete
  8. Great blog.thanks for sharing such a useful information
    Big Data Hadoop Training

    ReplyDelete
  9. Great blog.thanks for sharing such a useful information
    QTP Training

    ReplyDelete
  10. This post is so interactive and informative.keep update more information...
    dot net training in anna nagar
    Dot net training in Chennai

    ReplyDelete
  11. This post is so interactive and informative.keep update more information...
    PHP Training in Tambaram
    PHP Training in Tambaram

    ReplyDelete
  12. Awesome Blog. Thanks for sharing such a worthy information. Keep update like this...
    Why Learn Data Science is Important
    why data science is important in today’s world

    ReplyDelete
  13. This post is so interactive and informative.keep update more information...
    Java Training in Tambaram
    java course in tambaram

    ReplyDelete
  14. Great information. The above content is very interesting to read. Looking for the best online phonics classes for kindergarten, Ziyyara Edutech’s online phonics classes for kindergarten are designed to conquer the challenges like limited hands-on activities and pronunciation issues with expert guidance.
    visit Phonics for kindergarten

    ReplyDelete
  15. This is very nice post.I’m happy to see some great article on your site. Ziyyara Edutech spoken English classes in Saudi Arabia provide the platform for you to achieve linguistic excellence.
    For Book a demo now English language courses in Saudi Arabia

    ReplyDelete
  16. Really great post, Thank you for sharing This knowledge.Excellently written article, Unlock academic excellence with Ziyyara Edutech's specialized online tuition for Class 11.
    For more info Contact us: +91-9654271931, +971-505593798 or visit Online tuition for 11th class

    ReplyDelete
  17. Thank you for taking the time and sharing this information with us. Embark on a seamless online learning journey for your 2nd grader with our tailored home tuition classes.
    For more info visit Online tuition for class 2 near me

    ReplyDelete
  18. Packaging has been revolutionised by China Bopp adhesive tape film manufacturers films, which provide dependable and secure sealing options. The product will be kept intact or just minimally damaged during transportation since it is resistant to a broad variety of environmental conditions. Management of the supply chain and logistics are aided by this.

    ReplyDelete
  19. Amazon SEO Services in Chicago

    In today’s highly competitive e‑commerce environment, having a presence on Amazon is no longer enough — visibility matters. For brands and sellers in Chicago, Amazon SEO (Search Engine Optimization) Services are essential to outpace competitors, connect with more customers, and maximize sales. With millions of products listed on Amazon, strategic optimization ensures your listings don’t just exist — they get discovered.

    What Is Amazon SEO?

    Amazon SEO refers to the process of optimizing product listings so they rank higher in Amazon’s search results. Unlike traditional SEO for web pages, Amazon’s algorithm — known as A9 — prioritizes relevance and sales performance. In simple terms, Amazon wants to show products buyers are most likely to purchase. To achieve this, it evaluates keywords, conversion history, pricing, availability, customer reviews, and more.

    For Chicago sellers — whether small local brands, regional distributors, or nationwide e‑commerce businesses with a Chicago office — Amazon SEO isn’t optional. It’s a core strategy for growth in a marketplace where visibility directly influences sales velocity.

    Why Chicago Businesses Need Amazon SEO Services

    Chicago is a vibrant hub for retail and entrepreneurship, home to diverse industries ranging from fashion and food to electronics and wellness. As Chicago sellers expand onto Amazon, a well‑executed SEO strategy levels the playing field against national competitors.

    Here are key reasons Chicago businesses should invest in Amazon SEO:

    Increased Visibility: Optimized listings appear higher in Amazon search results, increasing impressions among target buyers.

    Improved Conversion: Strategic content and visuals not only attract clicks but also encourage purchases.

    Better Keyword Targeting: Voice search, mobile search, and long‑tail queries on Amazon require smart keyword research — something SEO professionals excel at.

    Enhanced Brand Credibility: High rankings and optimized listings build trust with customers who rely on reviews, clear descriptions, and professional imagery.

    Core Components of Amazon SEO Services

    Professional Amazon SEO Services typically include:

    1. Keyword Research and Optimization
    Finding high‑impact search terms relevant to your products is foundational. Unlike generic keywords, Amazon keywords must align with buyer intent — the phrases real customers use when ready to buy. This research informs titles, bullet points, backend search terms, and product descriptions.

    2. Listing Optimization
    A fully optimized listing includes:

    Compelling, keyword‑rich titles

    Informative bullet points highlighting features and benefits

    High‑quality product descriptions that answer buyer questions

    Backend search terms that expand discoverability

    3. Enhanced Brand Content / A+ Content
    For brand‑registered sellers, A+ Content allows richer visuals and storytelling — increasing conversions and differentiating products from competitors.

    4. Review and Reputation Management
    Positive reviews impact Amazon’s algorithm and buyer trust. SEO services often include strategies to ethically generate reviews and manage feedback.

    5. Performance Analytics and Continuous Optimization
    SEO isn’t a one‑time task. Ongoing monitoring of ranking shifts, conversion rates, and keyword performance allows sellers to stay ahead in a dynamic marketplace.

    Finding Amazon SEO Experts in Chicago

    Chicago businesses looking to optimize their Amazon presence can partner with experienced e‑commerce marketing agencies that specialize in marketplace strategies. These professionals combine technical SEO knowledge with marketplace insights to elevate your listings and improve sales performance.

    ReplyDelete
Previous Post Next Post