ES6.2.4 各位大佬们,现在有个需求,先根据姓名作为主查询,再根据企业ID分组,然后再自定义打分,ES是否支持?
POST demo/demo/_search
{
"query": {
"function_score": {
"query": {
"term": {
"name": "zhangsan"
}
},
"script_score": {
"script": {
"source": "doc['srank].value/doc['crank'].value"
}
},
"boost_mode": "replace"
},
"aggs": {
"avg_price": {
"avg": {
"field": "group_id"
}
}
}
}
}
报错,不支持function_score,里面聚合agg
POST demo/demo/_search
{
"query": {
"function_score": {
"query": {
"term": {
"name": "zhangsan"
}
},
"script_score": {
"script": {
"source": "doc['srank].value/doc['crank'].value"
}
},
"boost_mode": "replace"
},
"aggs": {
"avg_price": {
"avg": {
"field": "group_id"
}
}
}
}
}
报错,不支持function_score,里面聚合agg
0 个回复