正在获取错误502,{"ok":false,"message":"后端



我有两个索引1.第2部分。"ther";索引有24个字段;索引有19个字段。我必须丰富"ther";用";部分";索引字段。

字段";user_id";在两个索引之间很常见。使用丰富过程,我尝试创建第三个索引";part_ther";

get ther/_search
{
"_index" : "ther",
"_type" : "_doc",
"_id" : "2",
"_score" : 1.0,
"_source" : {
"Ahi" : 42.6,
"Index" : 90,
"ipapPressureAverage" : 49,
"MinuteVentAverage" : 20,
"DeviceSerialNumber" : "<>",
"ClearAirwayApneaIndex" : 72.26135463,
"PeriodicBreathingTime" : 9311,
"cpapPressure90Pct" : 22,
"epapPressureAverage" : 73,
"ipapPressure90Pct" : 27,
"Usage" : 93904,
"epapPressure90Pct" : 10,
"AverageBreathRate" : 65,
"@timestamp" : "2021-08-29T00:00:00.000+05:30",
"user_id" : "39,476",
"TrigBreathsPct" : 93,
"cpapPressureAverage" : 29,
"AverageExhaledTidalVolume" : 20,
"DayStorageDate" : "29-08-2021",
"UnintendedLeakageAverage" : 67.58
}

get part/_search
{
"_index" : "part",
"_type" : "_doc",
"_id" : "2",
"_score" : 1.0,
"_source" : {
"email" : "<>",
"program_id" : 1849,
"program_name" : "<> ",
"scheduled_program_id" : 4765,
"scheduled_program_name" : "<>",
"scheduled_program_status" : 0,
"experience_id" : 10129,
"experience_name" : "<>",
"response_id" : 364482,
"user_id" : 39476,
"firing_time" : "2021-09-19T09:28:51.000-04:00",
"opened_at" : null,
"participation_percentage" : 0,
"status" : "<>",
"created_at" : "2021-09-18T12:26:02.455-04:00",
"updated_at" : "2021-09-19T09:30:04.228-04:00",
"last_frame_completed_id" : null,
"realm" : "affective-part-364482",
"realms_organization_ids" : [
"<>"
]
}
}

使用丰富过程,我尝试创建第三个索引";另一部分";使得来自"0"的所有字段;ther";指数用";部分";指数

步骤-

PUT /_enrich/policy/ther-policy
{
"match": {
"indices": "ther",
"match_field": "user_id",
"enrich_fields": ["Ahi","AverageBreatheRate","AverageExhaledTidalVolume","ClearAirwayApneaIndex","cpapPressureAverage","cpapPressure90Pct","DayStorageDate","epapPressureAverage","epapPressure90Pct","ipapPressureAverage","ipapPressure90Pct","MinuteVentAverage","PeriodicBreathingTime","TrigBreathsPct","UnintendedLeakageAverage","Usage","DeviceSerialNumber"]
}
}
*****
Output-
{
"acknowledged" : true
}
*************
POST /_enrich/policy/ther-policy/_execute
Output-
{
"status" : {
"phase" : "COMPLETE"
}
}
*************************
PUT /_ingest/pipeline/ther_lookup
{
"description" : "Enriching user details with tracks",
"processors" : [
{
"enrich" : {
"policy_name": "ther-policy",
"field" : "user_id",
"target_field": "tmp",
"max_matches": "1"
}
},
{
"script": {
"if": "ctx.tmp != null",
"source": "ctx.putAll(ctx.tmp); ctx.remove('tmp');"
}
}
]
}
Output-
{
"acknowledged" : true
}
**************************
POST _reindex
{
"source": {
"index": "part"
},
"dest": {
"index": "part_ther",
"pipeline": "ther_lookup"

}
}

部分索引中的字段越来越丰富。索引";部分";以及";ther";只有2个文档,因为我正在测试富集处理器。

get part_ther/_search
{
"_index": "part_ther",
"_type": "_doc",
"_id": "1",
"_score": 1,
"_source": {
"Ahi": 42.6,
"response_id": 364482,
"program_id": 1849,
"program_name": "<> ",
"created_at": "2021-09-18T12:26:02.455-04:00",
"ipapPressureAverage": 49,
"MinuteVentAverage": 20,
"DeviceSerialNumber": "<>",
"scheduled_program_id": 4765,
"experience_id": 10129,
"ClearAirwayApneaIndex": 72.26135463,
"PeriodicBreathingTime": 9311,
"updated_at": "2021-09-19T09:30:04.228-04:00",
"scheduled_program_status": 0,
"cpapPressure90Pct": 22,
"email": "<>",
"epapPressureAverage": 73,
"ipapPressure90Pct": 27,
"last_frame_completed_id": null,
"Usage": 93904,
"participation_percentage": 0,
"epapPressure90Pct": 10,
"firing_time": "2021-09-19T09:28:51.000-04:00",
"opened_at": null,
"realms_organization_ids": [
"<>"
],
"user_id": "39476",
"scheduled_program_name": "<>",
"TrigBreathsPct": 93,
"cpapPressureAverage": 29,
"experience_name": "<>",
"AverageExhaledTidalVolume": 20,
"DayStorageDate": "29-08-2021",
"realm": "<>",
"UnintendedLeakageAverage": 67.58,
"status": "<>"
}

在"原始索引"中;治疗";索引有9k个文档;参与指数";拥有8万份文档。

当我试图在原始索引上创建第三个索引时,我会遇到错误。错误502,{"ok":false,"message":"backend closed connection"}如何避免这个错误并成功地丰富索引。

POST _reindex
{
"source": {
"index": "-participation"
},
"dest": {
"index": "data-participation-therapy1",
"pipeline": "therapy_lookup"
}
}
output-
{"ok":false,"message":"backend closed connection"}

感谢@Val澄清此错误。

后端关闭连接只是意味着客户端(即浏览器中的Kibana开发工具)超时但重新索引过程仍在后台进行

如果源索引很大,则终止操作所需的时间很可能超过超时时间。因此,您应该使用启动重新索引以异步运行

POST _reindex?wait_for_completion=false

呼叫将立即返回并给您一个任务ID,您可以使用该ID在使用进行任务时检查任务状态

GET _tasks/<task_id>

引用链接使用富集处理器富集新索引中的字段

最新更新