gpt4 book ai didi

elasticsearch 5.0原生插件,查询错误

转载 作者:行者123 更新时间:2023-12-03 01:51:10 26 4
gpt4 key购买 nike

我为 es 5.0 写了一个原生插件,extends Plugin implements ScriptPlugin , 和脚本 extends AbstractSearchScript ,安装正常,但是当我执行以下查询时:

"script_score": {
"script": {
"id": "my_script_factory_name",
"lang" : "native"
}
}

它失败并出现以下错误:
{"error":{"root_cause":[{"type":"resource_not_found_exception","reason":"Unable to find script [native/my_script_factory_name] in cluster state"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,

最佳答案

终于找到原因了,官方5.0文档是旧版指南,正确查询应该使用内联

"script_score": {
"script": {
"inline": "my_script_factory_name",
"lang" : "native",
"params": {
....
}
}
}

关于elasticsearch 5.0原生插件,查询错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40337284/

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