py elasticsearch中的无痛脚本抛出连接错误

py elasticsearch中的无痛脚本抛出连接错误,
Warning: implode(): Invalid arguments passed in /data/phpspider/zhask/webroot/tpl/detail.html on line 45
,,我有以下脚本搜索查询: bdy = { "query": { "function_score": { "script_score": { "script": { "lang": "painless", "inline": "def test = "+test1+"; float total = 0; for (int i = 0; i < doc['embedding_vector'].length; i++) { tot

我有以下脚本搜索查询:

bdy = {
 "query": {
   "function_score": {
     "script_score": {
       "script": {
         "lang": "painless",
         "inline": "def test = "+test1+"; float total = 0; for (int i = 0; i < doc['embedding_vector'].length; i++) { total += doc['embedding_vector'][i]*test[i]; } return total;"
       }
     }
   }
 }
}

ES服务器日志中是否有错误?您能为
test1
显示一个示例值吗?@Val test1是一个类似于“[0.0377055853605,0.000859705265611,-0.0299785286188,-0.00769839854911]”的向量,仅维度数为512。我得到的错误是ConnectionTimeout:ConnectionTimeout由-ReadTimeoutError引起(HTTPConnectionPool(host='localhost',port=9200):读取超时。(读取超时=10))
es.search(index="images", doc_type='image', body=bdy)