我无法使嵌套的过滤器排序正常工作。我有这样的Map-
"metadata": {
"type": "nested",
"include_in_parent": true,
"properties": {
"property": {
"type": "string",
"index" : "not_analyzed",
"include_in_parent" : false,
"include_in_all" : false
},
"type": {
"type": "string",
"index": "not_analyzed"
},
"value": {
"type": "string",
"fields": {
"lower_case_sort": {
"type": "string",
"analyzer": "case_insensitive_sort"
}
}
}
}
},
因此,每个文件都有属性为“duration”的元数据,值为duration值,例如50.300。这里我有一个查询,我正在做,但它不是返回结果上升或下降,它是随机的。
"query": {
"bool": {
"must": {
"term" : {
"parent.raw": "folderName"
}
}
}
},
"size": 50,
"from": 0,
"sort": {
"metadata.value": {
"order":"desc",
"nested_filter": {
"term": { "metadata.property":"duration" }
}
}
}
}
What could be the issue?
Thank you!
1条答案
按热度按时间njthzxwz1#
嵌套的\u路径和嵌套的\u过滤器选项已被弃用,取而代之的是6.1以上所述的选项。
尝试下面的搜索查询