FEATURE(2524): Use coalescing sort in cli search.
OTHER: Fix broken medialib test.

Ordering the union by id breaks the component ordering
which is the ordering the test tries to exercise.