Problem/Motivation
Currently Sorting on fields with cardinality > 1 yields completely nonsensical results, for example flipping ASC and DESC does ... nothing. Imagine entity1->field[0]->value being 1, entity1->field[1]->value being 4 , entity2->field[0]->value being 2 and entity2->field[1]->value being 3. In other words we try to order the (1,4) and (2,3) sets. Currently , on ascending we take the smallest values for a field, in case 1 and 2 so entity1 < entity2 and on descending we take the largest ones, in this case 4 and 3 so entity1 > entity2. That makes little sense.
Proposed resolution
As we want deltas to have meaning #2384459: Add entity query condition for delta in EFQ we could do better: instead of trying to order sets, we should order tuples. A simply lexicographic sort will do.
Remaining tasks
User interface changes
API changes
In certain cases the ordering result will change but the previous results were utterly broken.