ES 创建索引,重建索引

创建索引:
put:http://Ip:9201/product_v1

{
"aliases": {},
"mappings": {
"properties": {
"id": {
"type": "long"
},
"mId": {
"type": "long"
},
"productName": {
"type": "text"
},
"productNameCN": {
"type": "text",
"analyzer": "ik_max_word",
"search_analyzer": "ik_max_word"
},
"sKU": {
"type": "text"
}
}
},
"settings": {
"index": {
"number_of_shards": "1",
"number_of_replicas": "1"
}
}
}

重建索引:
put:http://Ip:9201/_reindex
{
"source": {
"index": "product_v1"/,
"query": {
"bool": {
"must": {
"range": {
"UpdateTime": {
"gt": "2024-08-19T18:26:00.000+08:00"
}
}
}
}
}
/
},
"dest": {
"index": "product_v2"
},
"script": {
"source": "ctx._source.remove("@timestamp");ctx._source.remove("@version");"
}
}

posted @ 2024-08-13 16:48  大树2  阅读(1)  评论(0编辑  收藏  举报