Use RestHighLevelClient How does ES Geo Shape check whether a coordinate is inside an electronic fence.