0
排序由外地的一些項目,其中一個條件匹配,別人比方說,我有這樣映射的文件:Elasticsearch:由另一個
{
"corp" : {
"mappings" : {
"staff" : {
"properties" : {
"created" : {
"type" : "date",
"format" : "dateOptionalTime"
},
"name" : {
"type" : "string"
},
"public" : {
"type" : "boolean"
},
"salary" : {
"type" : "long"
}
}
}
}
}
}
而且這樣的數據集:
[{"name": "John", "salary": 100000, "public": true, "created": "<datestamp>"},
{"name": "Bob", "salary": 80000, "public": false, "created": "<datestamp>"},
{"name": "Wendy", "salary": 110000, "public": true, "created": "<datestamp>"},
{"name": "Joan", "salary": 210000, "public": false, "created": "<datestamp>"}]
我想要構建一種排序,這樣我們按工資只排序其中public=true
,然後按created
字段排序其餘項目。最終的結果應該是:
- 溫迪
- 約翰
- 鮑勃(取決於
created
日期) - 瓊(取決於
created
日期)
這可能嗎?