Elasticsearch 5.4 Documents API

ELasticsearch文档的CRUD主要包括以下2个大的方面:单文档和多文档,翻译如下:

一、单文档API

1.1 Index API

写入文档,索引为twitter,type为tweet,id为1:

PUT twitter/tweet/1
{
    "user" : "kimchy",
    "post_date" : "2009-11-15T14:12:12",
    "message" : "trying out Elasticsearch"
}

返回结果:

{
  "_index": "twitter",
  "_type": "tweet",
  "_id": "1",
  "_version": 1,
  "result": "created",
  "_shards": { "total": 2, "successful": 1, "failed": 0 },
  "created": true }

1.2 Get API

1.3 Delete API

1.4 Update API

二、多文档API

2.1 Multi Get API

2.2 Bulk API

2.3 Delete By Query API

2.4 Update By Query API

2.5 Reindex API

你可能感兴趣的:(elasticsearch,api,crud,文档,es)