Modify user and resource index to be sorted by distance