gpt4 book ai didi

json - Elasticsearch:预期的字段名称但得到了 START_OBJECT

转载 作者:行者123 更新时间:2023-11-29 02:56:16 25 4
gpt4 key购买 nike

我一直在尝试运行以下查询,但每次运行时都会收到以下错误:

nested: ElasticsearchParseException[Expected field name but got START_OBJECT \"field_value_factor\"]; }]","status":400

这里是查询:

{
"query": {
"function_score": {
"query": {
"bool": {
"should": [{
"match": {
"thread_name": "parenting"
}
}, {
"nested": {
"path": "messages",
"query": {
"bool": {
"should": [{
"match": {
"messages.message_text": "parenting"
}
}]
}
},
"inner_hits": {}
}
}]
}
}
},
"field_value_factor": {
"field": "thread_view"
}
}
}

最佳答案

您的 field_value_factor 函数放错了地方。应该是nested within the functions property .改用这个查询

{
"query": {
"function_score": {
"functions": [
{
"field_value_factor": {
"field": "thread_view"
}
}
],
"query": {
"bool": {
"should": [
{
"match": {
"thread_name": "parenting"
}
},
{
"nested": {
"path": "messages",
"query": {
"bool": {
"should": [
{
"match": {
"messages.message_text": "parenting"
}
}
]
}
},
"inner_hits": {}
}
}
]
}
}
}
}
}

关于json - Elasticsearch:预期的字段名称但得到了 START_OBJECT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30456408/

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