POC, written in Java, with examples of spatial queries against Elasticsearch.
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Generic method to retrieve objects within certain distance and fix of… Apr 6, 2018
README.md Using generic ESPersistService Apr 23, 2018
pom.xml Using more generic ESPersistService May 3, 2018


Elasticsearch Spatial Queries POC


This project has been designed/developed as a POC. Focus of the POC is to test some Spatial Queries against Elasticsearch (ES).
For this POC, we use the RestHighLevelClient and rely entirely on REST.
Code has been written in Java 9. Feel free to spot the usage of JDK 9 syntax and to downgrade to Java 8 if necessary.
You can find 3 following types of Spatial Queries:

  • retrieve objects within certain distance
  • retrieve communes within rectangle/BoundingBox
  • retrieve communes within a polygon (implemented as a unit test)

Running the project

Running application locally

Boot a recent version of ES (preferably version 6.1.1)
mvn spring-boot:run -Dserver.port=8090




Base uri to access actuator endpoint: http://localhost:8090/admin.

JMX / Jolokia

Base uri to access Jolokia endpoint: http://localhost:8090/admin/jolokia.

Websites of interest