[elasticsearch] Index introduction

Index is a container of documents, a combination of a type of document

  • Index embodies the concept of logical space: each index has its own mapping definition, which is used to define the field names and field types of the documents it contains.

  • Shard sharding embodies the concept of physical space: data in the index is scattered on shard shards.

Index Mapping and Setting

  • Type of document defined by mapping
  • Setting defines different data distributions (such as how many shards and how many copies are specified)

Create index

PUT /my_index
{
    "mappings": {
        "properties": {
            "name": {
                "type": "text"
            },
            "age": {
                "type": "long"
            },
            "brithday": {
                "type": "date"
            }
        }
    }
}

View the mapping structure of the index

GET /my_index/_mapping

Guess you like

Origin blog.51cto.com/phpme/2668357