ranking of results based on distance and common_connections