试试搜索一下吧

es2.X 有关键词,有过滤,使用function score

匿名 | 发布于2016年04月22日 | 阅读数:4711

请问:
'query'   => [
                    'bool' => [
                        'must'   => $query,
                        'filter' => $filter,
                    ],
                ],
我在must外包了一层 function score,提示[bool] query does not support [function_score]
怎么破
已邀请:

helloes

赞同来自: hello

格式写错了。。
{
"query": {
"function_score": {
"field_value_factor": {},
"query": {
"bool": {
"must": {},
"filter": {}
}
}
}
}
}

hello

赞同来自:

非常感谢。
请问,
field_value_factor中我指定的字段目前存的是字符串,请问我可以在这一步进行强转int么。

要回复问题请先登录注册