码迷,mamicode.com
首页 > 其他好文 > 详细

ElasticSearch 查找

时间:2021-03-11 20:49:34      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:dea   target   lov   elastic   arch   _id   head   type   doc   

获取文档

检查文档是否存在 HEAD /_doc/0

HEAD /movies/_doc/1

200 - OK

获取GET /_doc/0

GET /movies/_doc/1
{
  "_index" : "movies",
  "_type" : "_doc",
  "_id" : "1",
  "_version" : 2,
  "_seq_no" : 9743,
  "_primary_term" : 8,
  "found" : true,
  "_source" : {
    "year" : 1995,
    "title" : "Dracula: Dead and Loving It1",
    "id" : "12",
    "genre" : [
      "Comedy"
    ]
  }
}

筛选源 多个源用,分割

GET /movies/_doc/1?_source_includes=id,year&_source_excludes=id 
{
  "_index" : "movies",
  "_type" : "_doc",
  "_id" : "1",
  "_version" : 2,
  "_seq_no" : 9743,
  "_primary_term" : 8,
  "found" : true,
  "_source" : {
    "year" : 1995
  }
}

ElasticSearch 查找

标签:dea   target   lov   elastic   arch   _id   head   type   doc   

原文地址:https://www.cnblogs.com/roinbi/p/14515679.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!