002 Index operation

I. Overview

Before learning relational database, we first need to create a data table, es in the study, we first learn the operation for the index.

When we learn the basic operations are carried out using kibana.

 

II. Creating an index 

Let's create an index of a user.

PUT /user

 When we ask in kibana, you will get the following content.

{
  "acknowledged" : true,
  "shards_acknowledged" : true,
  "index" : "user"
}

  We should be noted that acknowledged this property, it usually indicates whether the success of our operations.

 

III. Query Index

GET /user

  Response are as follows:

{
  "user" : {
    "aliases" : { },
    "mappings" : { },
    "settings" : {
      "index" : {
        "creation_date" : "1569423525583",
        "number_of_shards" : "1",
        "number_of_replicas" : "1",
        "uuid" : "yIpG_IGDSsaIZnBgr8Ff7Q",
        "version" : {
          "created" : "7030299"
        },
        "provided_name" : "user"
      }
    }
  }
}

  Here we can content above.

In the contents of the above, we can see the option to create an index of the fact that more and more.

aliases indicates the index of the alias.

mappings shows the structure of the index, we will focus on this later explained.

settings is a more important element, when creating the index, we can specify some special configuration items, such as a few slices, a few copies and so on.

 

IV. Delete Index

DELETE /user

  The results obtained were as follows:

{
  "acknowledged" : true
}

 We can get the results, we successfully removed the index. 

 

Guess you like

Origin www.cnblogs.com/trekxu/p/11588254.html