Elasticsearch之curl创建索引
Posted 大数据和人工智能躺过的坑
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Elasticsearch之curl创建索引相关的知识,希望对你有一定的参考价值。
前提,是
Elasticsearch之curl创建索引库
[hadoop@djt002 elasticsearch-2.4.3]$ curl -XPUT \'http://192.168.80.200:9200/zhouls/emp/1\' -d\'{"name":"tom","age":25}\'
{"_index":"zhouls","_type":"emp","_id":"1","_version":1,"_shards":{"total":2,"successful":1,"failed":0},"created":true}[hadoop@djt002 elasticsearch-2.4.3]$
即,"_index":"zhouls",是索引库是zhouls
"_type":"emp",是类型是emp
"_id":"1",是id是1
"_version":1,是版本是1
"_shards":{"total":2,"successful":1,"failed":0},是
"created":true,是创建索引提示成功!
这是REST风格!
含义:
zhouls,代表是索引库
emp代表类型,员工的意思
1代表id,
官网
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html
以上是关于Elasticsearch之curl创建索引的主要内容,如果未能解决你的问题,请参考以下文章