Book Image

ElasticSearch Cookbook

By : Alberto Paro
Book Image

ElasticSearch Cookbook

By: Alberto Paro

Overview of this book

Table of Contents (20 chapters)
ElasticSearch Cookbook Second Edition
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Managing index settings


Index settings are more important because they allow us to control several important ElasticSearch functionalities such as sharding/replica, caching, term management, routing, and analysis.

Getting ready

You will need a working ElasticSearch cluster and the index created in the Creating an index recipe in this chapter.

How to do it...

To manage the index settings, we will perform the steps given as follows:

  1. To retrieve the settings of your current Index, the URL format is the following:

    http://<server>/<index_name>/_settings
  2. We are reading information via REST API, so the method will be GET, and an example of a call using the index created in the Creating an index recipe, is:

    curl -XGET 'http://localhost:9200/myindex/_settings'
    
  3. The response will be something similar to:

    {
      "myindex" : {
        "settings" : {
          "index" : {
            "uuid" : "pT65_cn_RHKmg1wPX7BGjw",
            "number_of_replicas" : "1",
            "number_of_shards" : "2",
            "version" : {
      ...