Hi. I think there is a bug when sorting facets using alias.
Take a look, this:
{
q(func: uid(0x8f58)){
normal: classificacoes @facets(orderasc: _created_time) {
uid
descricao
}
facet_alias: classificacoes @facets(created: _created_time, orderasc: created) {
uid
descricao
}
}
}
Yields this:
{
"data": {
"q": [
{
"normal": [
{
"uid": "0x8d92",
"descricao": "Normal",
"normal|_created_time": "2018-09-07T18:40:34.755Z"
},
{
"uid": "0x8d7e",
"descricao": "Alerta",
"normal|_created_time": "2018-09-07T18:52:17.057Z"
},
{
"uid": "0x8d83",
"descricao": "Problema",
"normal|_created_time": "2018-09-07T18:52:32.778Z"
}
],
"facet_alias": [
{
"uid": "0x8d7e",
"descricao": "Alerta",
"created": "2018-09-07T18:52:17.057Z"
},
{
"uid": "0x8d83",
"descricao": "Problema",
"created": "2018-09-07T18:52:32.778Z"
},
{
"uid": "0x8d92",
"descricao": "Normal",
"created": "2018-09-07T18:40:34.755Z"
}
]
}
]
},
"extensions": {
"server_latency": {
"parsing_ns": 31733,
"processing_ns": 826947,
"encoding_ns": 1007517
},
"txn": {
"start_ts": 226780,
"lin_read": {
"ids": {
"1": 246678
}
}
}
}
}
Looks like its converting to string first and sorting by the string result, and not by the datetime value.