feat: There is no way the, 新需求 调整ES 检索规则 更新 es 操作文档

This commit is contained in:
super_liu
2022-06-17 15:21:38 +08:00
parent 71ac54b05e
commit dc902ab411
10 changed files with 165 additions and 27 deletions
@@ -3,6 +3,9 @@ bussstand/bussstand/_mapping?pretty&include_type_name=true
{
"bussstand": {
"properties": {
"standSortOrder": {
"type": "integer"
},
"BARQ": {
"type": "text",
"fields": {
+1 -10
View File
@@ -52,16 +52,7 @@ fulltextserch/fulltextserch/_mapping?pretty&include_type_name=true
"fielddata": true
},
"numberTitle": {
"type": "text",
"analyzer": "ik_max_word",
"search_analyzer": "ik_max_word",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"fielddata": true
"type": "integer"
},
"nameTitle": {
"type": "text",
+3
View File
@@ -3,6 +3,9 @@ laws/laws/_mapping?pretty&include_type_name=true
{
"laws": {
"properties": {
"standSortOrder": {
"type": "integer"
},
"BDTWJHLAWS": {
"type": "text",
"fields": {
+3
View File
@@ -3,6 +3,9 @@ stand/stand/_mapping?pretty&include_type_name=true
{
"stand": {
"properties": {
"standSortOrder": {
"type": "integer"
},
"BARQ": {
"type": "text",
"fields": {
+40
View File
@@ -0,0 +1,40 @@
索引/_update_by_query
{
"script": {
"source": "ctx._source['standSortOrder']=51"
},
"query": {
"bool": {
"must": [
{
"match": {
"sortTitle.keyword": "QC/T"
}
}
],
"must_not": [],
"should": []
}
}
}
根据是否存在"ipsub"字段,如果不存在,给信息增加字段"ipsub",并且赋值0
POST my_index / _update_by_query
{
"script": {
"source": "ctx._source['standSortOrder']=0"
},
"query": {
"bool": {
"must_not": [{
"exists": {
"field": "standSortOrder"
}
}]
}
}
}