gpt4 book ai didi

elasticsearch - Elasticsearch-访问嵌套变量

转载 作者:行者123 更新时间:2023-12-02 23:37:29 24 4
gpt4 key购买 nike

我想从我的数据中获取坐标。

"userLoc" : {
"locNm" : "Alexandra Road",
"coordinates" : [
103.8174926,
1.29143
],

我尝试了以下方法来获取坐标的第二个值,但没有成功。
"script": "return _score*doc['userLoc'].coordinates[1];"

出现以下错误。
{
"error": "SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[H94j5eYQRXantctqOKMduw][merchantindex][0]: QueryPhaseExecutionException[[merchantindex][0]: query[function score (_all:test,function=script[return _score*doc['userLoc'].coordinates[1];], params [null])],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: GroovyScriptExecutionException[ElasticsearchIllegalArgumentException[No field found for [userLoc] in mapping with types []]]; }{[H94j5eYQRXantctqOKMduw][merchantindex][1]: QueryPhaseExecutionException[[merchantindex][1]: query[function score (_all:test,function=script[return _score*doc['userLoc'].coordinates[1];], params [null])],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: GroovyScriptExecutionException[ElasticsearchIllegalArgumentException[No field found for [userLoc] in mapping with types []]]; }{[H94j5eYQRXantctqOKMduw][merchantindex][2]: QueryPhaseExecutionException[[merchantindex][2]: query[function score (_all:test,function=script[return _score*doc['userLoc'].coordinates[1];], params [null])],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: GroovyScriptExecutionException[ElasticsearchIllegalArgumentException[No field found for [userLoc] in mapping with types []]]; }{[H94j5eYQRXantctqOKMduw][merchantindex][3]: QueryPhaseExecutionException[[merchantindex][3]: query[function score (_all:test,function=script[return _score*doc['userLoc'].coordinates[1];], params [null])],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: GroovyScriptExecutionException[ElasticsearchIllegalArgumentException[No field found for [userLoc] in mapping with types []]]; }{[H94j5eYQRXantctqOKMduw][merchantindex][4]: QueryPhaseExecutionException[[merchantindex][4]: query[function score (_all:test,function=script[return _score*doc['userLoc'].coordinates[1];], params [null])],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: GroovyScriptExecutionException[ElasticsearchIllegalArgumentException[No field found for [userLoc] in mapping with types []]]; }]",
"status": 500
}

最佳答案

关于elasticsearch - Elasticsearch-访问嵌套变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28940317/

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