ES 5.5.1 mapping 中 copy_to丢失问题
匿名 | 发布于2019年06月26日 | 阅读数:2936
索引每周重新新建一个,之前多字段match_phrase使用should的方式,速度比较慢,想尝试通过copy_to优化一下,修改后的部分索引结构如下所示:
es版本:5.5.1
文档总数:247265994,索引主分片总大小342.7gb
环境:5台虚拟机,4core,16G,SSD es分配8G
哪位大神知道为啥吗?
{
"mdsindices_20190622": {
"aliases": {
"mdsindices": {}
},
"mappings": {
"resume": {
"properties": {
"beforeStage": {
"type": "keyword",
"store": true
},
"candidateName": {
"type": "text",
"store": true,
"fields": {
"candidateNameOriginal": {
"type": "keyword"
}
},
"copy_to": [
"match_full_text"
],
"analyzer": "onechar_analyzer"
},
"lastCompanyName": {
"type": "text",
"store": true,
"copy_to": [
"match_full_text"
],
"analyzer": "onechar_analyzer"
},
"lastPositionName": {
"type": "text",
"store": true,
"copy_to": [
"match_full_text"
],
"analyzer": "onechar_analyzer"
},
"lastSchoolName": {
"type": "text",
"store": true,
"copy_to": [
"match_full_text"
],
"analyzer": "onechar_analyzer"
},
"match_full_text": {
"type": "text",
"analyzer": "onechar_analyzer"
}
}
}
},
"settings": {
"index": {
"search": {
"slowlog": {
"threshold": {
"fetch": {
"warn": "4s",
"trace": "500ms",
"debug": "1s",
"info": "2s"
},
"query": {
"warn": "4s",
"trace": "500ms",
"debug": "1s",
"info": "2s"
}
}
}
},
"refresh_interval": "1s",
"number_of_shards": "10",
"provided_name": "mdsindices_20190622",
"max_result_window": "100000",
"creation_date": "1561136400041",
"analysis": {
"analyzer": {
"onechar_analyzer": {
"filter": [
"lowercase"
],
"type": "custom",
"tokenizer": "onechar"
}
}
},
"number_of_replicas": "1",
"uuid": "G-ZAL2ElR9-bWZJcAkDJsw",
"version": {
"created": "5050199"
}
}
}
}
}
在索引建好后,match_full_text不提供给业务查询时,copy_to字段运行正,mapping结构也正常,但是将检索条件切换为match_phrase match_full_text一段时间后,发现老文档可以检索到,新索引的文档却检索不到,但是使用原方式却可以检索到,并且在kibana中查询mdsindices_20190622的结构时发现copy_to属性不存在了,如下:{
"mdsindices_20190622": {
"aliases": {
"mdsindices": {}
},
"mappings": {
"resume": {
"_routing": {
"required": true
},
"properties": {
"beforeStage": {
"type": "keyword",
"store": true
},
"candidateName": {
"type": "text",
"store": true,
"fields": {
"candidateNameOriginal": {
"type": "keyword"
}
},
"analyzer": "onechar_analyzer"
},
"channel": {
"type": "integer",
"store": true
},
"channelId": {
"type": "integer",
"store": true
},
"channelName": {
"type": "keyword",
"store": true
},
"channelType": {
"type": "keyword",
"store": true
},
"companyId": {
"type": "integer",
"store": true
},
"cooperationUserId": {
"type": "integer",
"store": true
},
"createTime": {
"type": "date",
"store": true,
"format": "date_optional_time||yyyy-MM-dd HH:mm:ss||epoch_millis"
},
"cuserId": {
"type": "integer",
"store": true
},
"deliverTime": {
"type": "date",
"store": true,
"format": "date_optional_time||yyyy-MM-dd HH:mm:ss||epoch_millis"
},
"educational": {
"type": "keyword",
"store": true
},
"email": {
"type": "text",
"store": true,
"fields": {
"emailOriginal": {
"type": "keyword"
}
},
"analyzer": "onechar_analyzer"
},
"entryTime": {
"type": "date",
"store": true,
"format": "date_optional_time||yyyy-MM-dd HH:mm:ss||epoch_millis"
},
"famousCompany": {
"type": "boolean",
"store": true
},
"famousSchool": {
"type": "boolean",
"store": true
},
"fileId": {
"type": "keyword",
"store": true
},
"id": {
"type": "long",
"store": true
},
"interviewTime": {
"type": "date",
"store": true,
"format": "date_optional_time||yyyy-MM-dd HH:mm:ss||epoch_millis"
},
"isParsed": {
"type": "boolean",
"store": true
},
"lastCompanyName": {
"type": "text",
"store": true,
"analyzer": "onechar_analyzer"
},
"lastPositionName": {
"type": "text",
"store": true,
"analyzer": "onechar_analyzer"
},
"lastSchoolName": {
"type": "text",
"store": true,
"analyzer": "onechar_analyzer"
},
"match_full_text": {
"type": "text",
"analyzer": "onechar_analyzer"
},
"onlinePositionId": {
"type": "integer",
"store": true
},
"outerDeliverId": {
"type": "keyword",
"store": true
},
"parentPositionRecruiterUserId": {
"type": "integer",
"store": true
},
"pdfId": {
"type": "keyword",
"store": true
},
"phone": {
"type": "text",
"store": true,
"fields": {
"phoneOriginal": {
"type": "keyword"
}
},
"analyzer": "onechar_analyzer"
},
"portrait": {
"type": "keyword",
"store": true
},
"positionId": {
"type": "integer",
"store": true
},
"positionName": {
"type": "keyword",
"store": true,
"fields": {
"positionNameText": {
"type": "text",
"analyzer": "onechar_analyzer"
}
}
},
"recruiterUserId": {
"type": "integer",
"store": true
},
"recruiterUserIdnotShield": {
"type": "integer",
"store": true
},
"refuseUserId": {
"type": "integer",
"store": true
},
"resumeDetail": {
"type": "text",
"analyzer": "onechar_analyzer"
},
"resumeOwnerId": {
"type": "integer",
"store": true
},
"resumeStage": {
"type": "keyword",
"store": true
},
"resumeSubStage": {
"type": "keyword",
"store": true
},
"sex": {
"type": "keyword",
"store": true
},
"sortTime": {
"type": "date",
"store": true,
"format": "date_optional_time||yyyy-MM-dd HH:mm:ss||epoch_millis"
},
"stageEnterTime": {
"type": "date",
"store": true,
"format": "date_optional_time||yyyy-MM-dd HH:mm:ss||epoch_millis"
},
"tags": {
"type": "text",
"store": true,
"fields": {
"tagOriginal": {
"type": "keyword"
}
},
"analyzer": "onechar_analyzer"
},
"updateTime": {
"type": "date",
"store": true,
"format": "date_optional_time||yyyy-MM-dd HH:mm:ss||epoch_millis"
},
"workYear": {
"type": "float",
"store": true
}
}
}
},
"settings": {
"index": {
"search": {
"slowlog": {
"threshold": {
"fetch": {
"warn": "4s",
"trace": "500ms",
"debug": "1s",
"info": "2s"
},
"query": {
"warn": "4s",
"trace": "500ms",
"debug": "1s",
"info": "2s"
}
}
}
},
"refresh_interval": "1s",
"number_of_shards": "10",
"provided_name": "mdsindices_20190622",
"max_result_window": "100000",
"creation_date": "1561136400041",
"analysis": {
"analyzer": {
"onechar_analyzer": {
"filter": [
"lowercase"
],
"type": "custom",
"tokenizer": "onechar"
}
}
},
"number_of_replicas": "1",
"uuid": "G-ZAL2ElR9-bWZJcAkDJsw",
"version": {
"created": "5050199"
}
}
}
}
}
es版本:5.5.1
文档总数:247265994,索引主分片总大小342.7gb
环境:5台虚拟机,4core,16G,SSD es分配8G
哪位大神知道为啥吗?
0 个回复