首页 > 移动平台 > 详细

Elasticsearch之Nested Object Mapping

时间:2015-04-15 14:53:57      阅读:299      评论:0      收藏:0      [点我收藏+]

Setting up a nested field is simple—where you would normally specify type object, make it type nested instead:

  创建一个nested 字段很简单——只要在你通常指定object类型的地方,改成nested类型就行:

 

curl -XPUT 'localhost:9200/my_index' -d '
{
  "mappings":{
     "blogpost":{
	     "properties":{
		     "comments":{
			    "type":"nested",
				"properties":{
				   "name":    {"type":"string"    },
				   "comment": { "type": "string"  },
                   "age":     { "type": "short"   },
                   "stars":   { "type": "short"   },
                   "date":    { "type": "date"    }
				}
			 }
		 }
	 }
  }
}

原文:http://www.elastic.co/guide/en/elasticsearch/guide/master/nested-mapping.html

Elasticsearch之Nested Object Mapping

原文:http://blog.csdn.net/allenalex/article/details/45058515

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