Initial support for sortBy queries