1、根据文档id更新
POST vic_score_much_index_49_202206/_doc/506499385/_update
{
"doc": {
"is_issue": 0
}
}
2、根据条件更新
POST vic_score_much_index_49_202206/_doc/_update_by_query
{
"query": {
"match": {
"contact_id": "2022061712242692642637S1"
}
},
"script": {
"source": "ctx._source['is_issue']=0"
}
}
POST vic_score_much_index_49_202206/_doc/_update_by_query
{
"query": {
"term": {
"plan_id": 12955
}
},
"script": {
"source": "ctx._source['is_issue']=0"
}
}
3、查询某个字段不为空
{
"query": {
"exists": {
"field": "human_plan_span"
}
}
}
4.es索引创建模板(GET _template/vic_asr_log_template(get查看,put创建))
PUT _template/vic_asr_log_template
{
"order": 3,
"index_patterns": [
"vic_asr_log_*"
],
"settings": {
"index": {
"number_of_shards": "3",
"number_of_replicas": "1"
}
},
"mappings": {
"properties": {
"asrTime": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"contactId": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"asrText": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 7000,
"type": "keyword"
}
}
},
"asrJson": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"asrDateTime": {
"type": "long"
}
}
},
"aliases": {
}
}
5.es修改索引属性(ignore_above)(原ignore_above为256,现修改为7000,极限8000(网上查询))
PUT vic_asr_log_202403/_mappings
{
"properties": {
"asrText": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 7000,
"type": "keyword"
}
}
}
}
}
6.es新增数据
POST http://10.125.128.187:3888/vic_asr_log_202303/_doc
{
"name":"张三"
}
7.
标签:语句,vic,请求,keyword,text,ignore,above,type,es From: https://www.cnblogs.com/xu-m/p/17217306.html