码迷,mamicode.com
首页 > 移动开发 > 详细

Elasticsearch之Nested Object Mapping

时间:2015-04-15 14:54:06      阅读:147      评论:0      收藏:0      [点我收藏+]

标签:elasticsearch   nested   嵌套   

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

标签:elasticsearch   nested   嵌套   

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

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