赞
踩
索引创建
{ "settings": { "number_of_shards": 3, "number_of_replicas": 1 }, "mappings": { "man": { "properties": { "name": { "type": "text" }, "country": { "type": "keyword" }, "age": { "type": "integer" }, "date": { "type": "date", "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis" } } }, "woman": { } } } //参数介绍 number_of_shards 分片数 number_of_replicas 备份数 mappings 索引映射 man字段, properties为man字段下的映射属性 type为字段的类型
使用Postman提交索引创建请求
http://127.0.0.1:9200/people 创建people索引,PUT请求,请求参数json形式如上
{ "novel": { "properties": { "author": { "type": "keyword" }, "word_count": { "type": "integer" }, "publish_date": { "type": "date", "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis" } } } }
请求url http://127.0.0.1:9200/book/novel/_mapping 请求类型POST
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。