Why second order not work?

The query is first sorted by age and then by name.
But the results are not in ascending order by name.

@youyin123, Multiple sorting is only allowed by predicates. In your case, you have used val(diff) so multiple sorting is not allowed and orderasc:name is ignored. I am not totally sure about why multiple sorting is not allowed and what is the workaround.

@MichelDiz do you have some idea?

Nope, feels like it is a bug. Cuz I think we have added support for multiple sorting. We have it on facets https://github.com/dgraph-io/dgraph/pull/4579 - why we don’t on root?


oh, you said we do. So @ahsan what is the reason why we can’t combine value variable sorting with predicate?

@youyin123, We currently do not support multiple sorting which involves value variables. It is only supported for predicates. Ideally, dgraph should have thrown an error for your query. Would you please file an issue for it?


sorry, in fact, I don’t know how to use GitHub …

We don’t use Github for issues anymore. You can fill up your issues at https://discuss.dgraph.io/c/issues/dgraph/38