Fix that limits/order-bys were being applied at the wrong stage in search queries.