order by primary keys if no order_by is provided

We were seeing test failures in our project because the ordering of search results is not necessarily deterministic if no order_by is specified. This makes API responses deterministic; the same request always returns the same ordering of results.