Rank by distance between geo_shape and geo_point

I have a sparsely-populated geography filled with smallish geoshapes (service areas). Given a geopoint or if possible, multiple geopoints (user location/s), I want to return results of a search ranked (in part) by proximity.

The scripting module provides an easy way to rank by distance between two geopoints: https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html

Is there a way to rank by distance between a geopoint and a geoshape or between two geoshapes?