赞
踩
#### i 新建索引
PUT /product_v2
```json
{
"settings": {
"analysis": {
"analyzer": {
"ik": {
"tokenizer": "ik_smart"
},
"douhao": {
"tokenizer": "douhao_tokenizer"
}
},
"tokenizer": {
"douhao_tokenizer": {
"type": "pattern",
"pattern": ","
}
}
}
},
"mappings": {
"record": {
"properties": {
//定义字段类型
"Id": {
"type": "long"
},
}
}
}
}
```
#### ii 将老索引导入新索引办法
POST /_reindex
{"source":{"index":"原索引名称"},"dest":{"index":"要导入新索引名称"}}
#### iii 新建索引别名方法
PUT /_aliases
{"actions":[{"remove":{"alias":"product","index":"原索引名称"}},{"add":{"alias":"product","index":"新建索引名称"}}]}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。