更新时间:2021-08-16 16:30:20
您的field_value_factor
函数放错了位置.它应嵌套在functions
属性.尝试使用此查询
Your field_value_factor
function is misplaced. it should be nested within the functions
property. Try this query instead
{
"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": {}
}
}
]
}
}
}
}
}