# 根据条件更新字段
POST bss_lst_clue_index/_update_by_query
{
"query": {
"match": {
"clueId": "11838"
}
},
"script": {
"source": "ctx._source['recycleDate'] = params['recycleDate']",
"params": {
"recycleDate": 1723132800000
}
}
}
# 线索基本信息查询
GET bss_lst_clue_index/_search
{
"query": {
"bool": {
"must": [{
"term": {
"bdCode": "GSQD25092"
}
},
{
"term": {
"type": 2
}
},
{
"term": {
"status": 3
}
}],
"filter": [{
"range": {
"recycleDate": {
"lte": 1723219200000
}
}
}]
}
},
"track_total_hits": true
}
# 两种方式都可行
GET bss_lst_clue_index/_search
{
"query": {
"constant_score" : {
"filter" : {
"bool" : {
"must" : [
{ "term" : { "bdCode" : "GSZN25772" } },
{ "term" : { "type" : 2 } },
{ "term" : { "status" : 3 } }
]
}
}
}
}
}
# 线索统计记录数, 返回结果字段解释
# "count": 表示匹配查询条件的文档总数。
# "_shards": 包含有关搜索分片的信息。
# "total": 参与搜索的分片总数。
# "successful": 成功执行搜索的分片数。
# "skipped": 跳过的分片数,通常是因为它们不可用。
# "failed": 执行搜索失败的分片数。
GET bss_lst_clue_index/_count
{
"query": {
"bool": {
"must": [{
"term": {
"bdCode": "GSQD1209"
}
},
{
"term": {
"type": 2
}
},
{
"term": {
"status": 3
}
}],
"filter": [{
"range": {
"recycleDate": {
"lte": 1723219200000
}
}
}]
}
}
}
# 删除字段_update/{"_id" : "11838"}
POST bss_lst_clue_index/_update/11838
{
"script": {
"source": "ctx._source.remove(\"column\")",
"lang": "painless"
}
}
01-06
2289
07-28
1万+
01-06
1634
12-04
1059
10-01
459