gpt4 book ai didi

elasticsearch - 尝试模拟管道时出错

转载 作者:行者123 更新时间:2023-12-03 00:34:58 29 4
gpt4 key购买 nike

我试图创建一个gsub管道,但在此之前,我尝试通过遵循Internet上的许多示例对其进行仿真。这是我的代码:

PUT _ingest/pipeline/removescript/_simulate
{
"pipeline" :{
"description": "remove script",
"processors": [
{ "gsub" :{
"field": "content",
"pattern": "(?:..)[^<%]+[^%>](?:..)",
"replacement": ""
}
}]
},
"docs": [
{
"_id": "tt",
"_source": {
"content": "leave <% remove me %> Me"
}
}]
}

但是,当我运行它时,出现以下错误:

No handler found for uri [/_ingest/pipeline/removescript/_simulate] and method [PUT]



如果我将PUT线更改为: PUT _ingest/pipeline/_simulatePUT _ingest/pipeline/removescript
然后我收到以下错误:
{
"error": {
"root_cause": [
{
"type": "parse_exception",
"reason": "[processors] required property is missing",
"header": {
"property_name": "processors"
}
}
],
"type": "parse_exception",
"reason": "[processors] required property is missing",
"header": {
"property_name": "processors"
}
},
"status": 400
}

最佳答案

_simulate endpoint仅适用于POST,不适用于PUT:

POST _ingest/pipeline/removescript/_simulate
{
...
}

关于elasticsearch - 尝试模拟管道时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47590163/

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