feat: There is no way the, 新需求 调整ES 检索规则 更新 es 操作文档
This commit is contained in:
@@ -3,6 +3,9 @@ bussstand/bussstand/_mapping?pretty&include_type_name=true
|
||||
{
|
||||
"bussstand": {
|
||||
"properties": {
|
||||
"standSortOrder": {
|
||||
"type": "integer"
|
||||
},
|
||||
"BARQ": {
|
||||
"type": "text",
|
||||
"fields": {
|
||||
|
||||
@@ -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,6 +3,9 @@ laws/laws/_mapping?pretty&include_type_name=true
|
||||
{
|
||||
"laws": {
|
||||
"properties": {
|
||||
"standSortOrder": {
|
||||
"type": "integer"
|
||||
},
|
||||
"BDTWJHLAWS": {
|
||||
"type": "text",
|
||||
"fields": {
|
||||
|
||||
@@ -3,6 +3,9 @@ stand/stand/_mapping?pretty&include_type_name=true
|
||||
{
|
||||
"stand": {
|
||||
"properties": {
|
||||
"standSortOrder": {
|
||||
"type": "integer"
|
||||
},
|
||||
"BARQ": {
|
||||
"type": "text",
|
||||
"fields": {
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user