Elasticsearch geo distance filter on a point type geo shape

So I have a location field in my documents (posts). This location
field is a geo shape. It could be a point or a polygon. Sometimes I may
have to use geo distance filter to get posts tagged closest to some
coordinate (only posts with point type geo shape not polygons). However, on attempting to use the geo_distance filter I encountered the following error.

... nested: QueryParsingException[[naya] failed to find geo_point field [location]]; }] ...',

Is there a way to use geo_distance filter on geo shapes that are point type?