elasticsearch 创建type及插入数据
2016-05-21 11:04
405 查看
创建 type ("store":"yes")
PUT my_index
{
"mappings": {
"type_one": {
"properties": {
"text": {
"type": "string",
"analyzer": "standard"
}
}
},
"type_two": {
"properties": {
"text": {
"type": "string",
"analyzer": "standard"
}
}
}
}
}
PUT my_index/_mapping/type_one
{
"properties": {
"text": {
"type": "string",
"analyzer": "standard",
"search_analyzer": "whitespace"
}
}
}
PUT my_index/_mapping/type_one?update_all_types
{
"properties": {
"text": {
"type": "string",
"analyzer": "standard",
"search_analyzer": "whitespace"
}
}
}
//测试
{
"properties": {
"name": {
"analyzer": "standard",
"store": true,
"type": "string"
},
"text": {
"analyzer": "standard",
"store": true,
"type": "string"
},
"ziduan": {
"search_analyzer": "ik",
"analyzer": "standard",
"type": "string"
},
"title": {
"analyzer": "standard",
"store": true,
"type": "string"
},
"datt": {
"format": "yyyy/mm/dd",
"store": true,
"type": "date"
}
}
}
{
"name": "名称",
"text": "文本",
"ziduan": "字段",
"title": "标题",
"datt": "2016/03/04"
}
https://www.elastic.co/guide/en/elasticsearch/reference/2.2/indices-put-mapping.html
PUT my_index
{
"mappings": {
"type_one": {
"properties": {
"text": {
"type": "string",
"analyzer": "standard"
}
}
},
"type_two": {
"properties": {
"text": {
"type": "string",
"analyzer": "standard"
}
}
}
}
}
PUT my_index/_mapping/type_one
{
"properties": {
"text": {
"type": "string",
"analyzer": "standard",
"search_analyzer": "whitespace"
}
}
}
PUT my_index/_mapping/type_one?update_all_types
{
"properties": {
"text": {
"type": "string",
"analyzer": "standard",
"search_analyzer": "whitespace"
}
}
}
//测试
{
"properties": {
"name": {
"analyzer": "standard",
"store": true,
"type": "string"
},
"text": {
"analyzer": "standard",
"store": true,
"type": "string"
},
"ziduan": {
"search_analyzer": "ik",
"analyzer": "standard",
"type": "string"
},
"title": {
"analyzer": "standard",
"store": true,
"type": "string"
},
"datt": {
"format": "yyyy/mm/dd",
"store": true,
"type": "date"
}
}
}
{
"name": "名称",
"text": "文本",
"ziduan": "字段",
"title": "标题",
"datt": "2016/03/04"
}
https://www.elastic.co/guide/en/elasticsearch/reference/2.2/indices-put-mapping.html
相关文章推荐
- CodeForces - 672D Robin Hood (二分)好题
- ubuntu终端su认证失败:允许su到root的方法
- 终端、网络到服务端(一)从日常vps云服务器的管理看数据包的传输
- 几种常用的本地化存储方式
- 我读《精进》——05 修炼思维
- 【Android】四种基本布局
- UIWindow
- UIWindow
- 自定义 Windows RE 体验
- 拜访
- 符号性和符号扩展
- Ubuntu 16.04下安装VMware Tools
- IOS中 Block用法进阶一
- TOMCAT的目录结构 1++ Tomact的一些小配置2++Java Web开发: Tomcat中部署项目的三种方法
- Nodejs中的异步编程类库Async
- 纪念CSDN博客突破两万名
- 策略模式
- Universal-imageLoader缓存图片加载
- 人类意识永存
- mysql ERROR 1062: ALTER TABLE causes auto_increment resequen