返回儿童分数,但是它没有按顺序排序。 我尝试添加“ function_score”和“ score_mode”:最大值。但是,它仍然没有按顺序排列。不太清楚我应该怎么做才能使其正常工作。 好心提醒。
POST _scripts/my_script
{
"script" : {
"lang" : "mustache","source" : """
{
"size": 200,"query":{
"function_score":{
"query": {
"bool": {
"should": [
{
"match": {
"name": {
"query": "{{query}}",}
}
},{
"has_child": {
"type": "phone","score_mode": "max","inner_hits": {
"highlight": {
"fields": {
"*": {
}
}
}
},"query": {
"match": {
"phone_number": {
"query" :"{{query}}",}
}
}
}
},{
"has_child": {
"type": "product","query": {
"match": {
"product_num": {
"query" :"{{query}}"
}
}
}
}
}
]
}
}
}
}
}
"""
}
}
预期的内部匹配项将按desc顺序排序,但未排序。