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.
Why?

@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 Add support for sorting on multiple facets by ashish-goswami · Pull Request #4579 · dgraph-io/dgraph · GitHub - why we don’t on root?

Update:

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?

Thanks

@ahsan
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 Dgraph - Discuss Dgraph