POST /mini_laws/_update_by_query
{
“script”:{
“source”: “ctx._source.hits = 0”
},
“query”: {
“bool”: {
“must_not”: {
“exists”: {
“field”: “hits”
}
}
}
}
}
根据query进行修改
这个博客内容涉及Elasticsearch的操作,通过POST /mini_laws/_update_by_query API,使用脚本更新所有缺失hits字段的文档,将hits字段设置为0。这是一个针对数据索引维护和管理的示例。
摘要由CSDN通过智能技术生成