新增数据:

--命令
PUT /spouse/female/5
{
  "name":"lengmeng",
  "age":25,
  "desc":"actress"
}

运行结果:
{
  "_index" : "spouse",  
  "_type" : "female",
  "_id" : "5",
  "_version" : 1,
  "result" : "created",
  "_shards" : {
    "total" : 2,
    "successful" : 1,
    "failed" : 0
  },
  "_seq_no" : 5,
  "_primary_term" : 1
}

简单查询spouse索引

GET /spouse

查询某个文档ID

GET /spouse/female/1

{
  "_index" : "spouse",
  "_type" : "female",
  "_id" : "1",
  "_version" : 1,
  "_seq_no" : 0,
  "_primary_term" : 1,
  "found" : true,
  "_source" : {
    "name" : "llj",
    "age" : 22,
    "desc" : "most beauteful"
  }
}

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐