Cannot sort records by distance without filtering by a radius

I’m trying sort my records by distance without filtering them by a radius but I’ve failed to do so. Normally, to filter records by radius, I set aroundLatLng and aroundRadius. And it works without a problem. Records are filtered and sorted. But when I set aroundRadius to "all", records are not sorted at all. Note that I set aroundLatLng in both cases. In the docs, it’s stated that geo criterion must be present in the ranking formula to sort by distance and I confirmed that it is present. So what could be the problem here? Any help would be appreciated.

I’ve realized that records are not sorted by distance in both cases even though the Geo ranking criterion is present in the ranking formula. What kind of change should I make to be able to sort by distance?

The problem was that the default ranking criteria did not exist. In Ranking and Sorting section of my index, I’ve reset settings to default and the default ranking criteria appeared. After that, I’ve been able sort records by distance. Below is a screenshot that shows the Ranking and Sorting section after resetting settings to default.