gpt4 book ai didi

elasticsearch - 获取错误 502, {“ok” :false, ”message”:”backend closed connection”} 用于将字段丰富到另一个索引

转载 作者:行者123 更新时间:2023-12-05 02:39:03 27 4
gpt4 key购买 nike

我有两个索引 1.ther 2.part。“ther”索引有 24 个字段,“part”索引有 19 个字段。我必须用“part”索引字段丰富“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" : [
"<>"
]
}
}

使用丰富过程,我尝试创建第三个索引“ther-part”,以便“ther”索引中的所有字段都用“part”索引丰富。

步骤-

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"

}
}

part_ther 索引中的字段越来越丰富。索引“part”和“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": "<>"
}

在原始索引中,“治疗”索引有 9000 个文档,“参与索引”有 80000 个文档。

当我尝试在原始索引上创建第三个索引时,出现错误。错误502,{"ok":false,"message":"后端关闭连接"}如何避免此错误并成功丰富索引。

POST _reindex
{
"source": {
"index": "-participation"
},
"dest": {
"index": "data-participation-therapy1",
"pipeline": "therapy_lookup"
}
}

output-
{"ok":false,"message":"backend closed connection"}

最佳答案

谢谢,@Val 澄清了这个错误。

backend closed connection 仅表示客户端(即浏览器中的 Kibana Dev Tools)超时。 但重建索引过程仍在后台进行。

如果您的源索引很大,很可能需要比超时时间更长的时间才能终止操作。所以你应该开始你的重新索引以使用异步运行

POST _reindex?wait_for_completion=false

调用将立即返回并为您提供一个任务 ID,您可以使用它来检查任务的状态

GET _tasks/<task_id>

引用链接- Enrich fields in new index using enrich processor

关于elasticsearch - 获取错误 502, {“ok” :false, ”message”:”backend closed connection”} 用于将字段丰富到另一个索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69257263/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com