Consider this data:
_:a <name> "alice" .
_:a <class> "5" .
_:b <name> "bob" .
_:b <class> "2" .
_:c <name> "cat" .
_:c <age> "12" .
_:d <name> "deg" .
_:d <age> "13" .
and this query:
data(func: has(age)){
t as uid
}
task(func: uid(t), orderasc: class){
uid
name
}
Clearly, all the nodes which have age
doesn’t have the class
predicate. So all uid(t) nodes doesn’t have class
predicate. What should be the expected from orderasc
in this case when the sort predicate (class
) is not present in any of the nodes?
Observation:
If we have <class>: string .
in schema, i.e. the class
predicate is not indexed, then we get this response:
"task": [
{
"uid": "0x96",
"name": "cat"
},
{
"uid": "0x97",
"name": "dog"
}
]
while, if we have <class>: string @index(exact) .
in schema. That is, the class predicate is indexed. The the response is:
"task": []
What should be the ideal behaviour of sorting in these cases?