创建索引之前可以对索引做初始化操作, 比如指定shards数量以及replicas的数量。 library为索引的名称
CURL -XPUT 'http://192.168.1.10:9200/library/' -d '{
"settings": {
"index": {
"number_of_shards": 5,
"number_of_replicas": 1
}
}
}'
CURL -XGET 'http://192.168.1.10:9200/library/_settings'
CURL -XGET 'http://192.168.1.10:9200/library,library2/_settings'
CURL -XGET 'http://192.168.1.10:9200/_all/_settings'
PUT /twitter/tweet/3
{
"title":"Elasticsearch:the Defimitive Guide",
"name" :{
"first":"zhangchang",
"last":"tong"
},
"publish_date":"2015-02-06",
"price":"49.999"
}
GET /twitter/tweet/3?_source=title,source 取title
- 更新
-
-
-
-
-
POST /twitter/tweet/3/_update
{
"doc": {
"title":"fly"
}
}
-
-
-
-
-