Sort results by namespace