首页 > 其他 > 详细

elasticsearch ——id字段说明,内部是_uid

时间:2017-02-24 12:02:42      阅读:1082      评论:0      收藏:0      [点我收藏+]

_id field

Each document indexed is associated with a _type (see the section called “Mapping Typesedit”) and an_id. The _id field is not indexed as its value can be derived automatically from the _uid field.

The value of the _id field is accessible in certain queries (termtermsmatchquery_string,simple_query_string), but not in aggregations, scripts or when sorting, where the _uid field should be used instead:

# Example documents
PUT my_index/my_type/1
{
  "text": "Document with ID 1"
}

PUT my_index/my_type/2&refresh=true
{
  "text": "Document with ID 2"
}

GET my_index/_search
{
  "query": {
    "terms": {
      "_id": [ "1", "2" ] 技术分享
    }
  }
}

技术分享

Querying on the _id field (also see the ids query)

elasticsearch ——id字段说明,内部是_uid

原文:http://www.cnblogs.com/bonelee/p/6437808.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!