Repository: gisaia/ARLAS-server (language: python)

Issue:
Update Elasticsearch to 7.14



Discussion / hints:

Fix patch:
diff --git a/README.md b/README.md
index 35f5efe7c..785867872 100644
--- a/README.md
+++ b/README.md
@@ -33,6 +33,8 @@ You need a Java Runtime (JRE) 8 and an ElasticSearch server running. ARLAS is co
 | 7.7.1 |
 | 7.8.1 |
 | 7.9.2 |
+| 7.12.1 |
+| 7.14.2 |
 
 ## Build
 
diff --git a/arlas-core/src/main/java/io/arlas/server/core/impl/elastic/services/ElasticCollectionReferenceService.java b/arlas-core/src/main/java/io/arlas/server/core/impl/elastic/services/ElasticCollectionReferenceService.java
index 559f17dc4..8b2f298e9 100644
--- a/arlas-core/src/main/java/io/arlas/server/core/impl/elastic/services/ElasticCollectionReferenceService.java
+++ b/arlas-core/src/main/java/io/arlas/server/core/impl/elastic/services/ElasticCollectionReferenceService.java
@@ -39,7 +39,7 @@
 import org.elasticsearch.action.search.SearchRequest;
 import org.elasticsearch.action.search.SearchResponse;
 import org.elasticsearch.action.search.SearchScrollRequest;
-import org.elasticsearch.common.unit.TimeValue;
+import org.elasticsearch.core.TimeValue;
 import org.elasticsearch.index.IndexNotFoundException;
 import org.elasticsearch.index.query.QueryBuilder;
 import org.elasticsearch.index.query.QueryBuilders;
diff --git a/arlas-core/src/main/java/io/arlas/server/core/impl/elastic/services/ElasticFluidSearch.java b/arlas-core/src/main/java/io/arlas/server/core/impl/elastic/services/ElasticFluidSearch.java
index f40d3e80e..a79157869 100644
--- a/arlas-core/src/main/java/io/arlas/server/core/impl/elastic/services/ElasticFluidSearch.java
+++ b/arlas-core/src/main/java/io/arlas/server/core/impl/elastic/services/ElasticFluidSearch.java
@@ -40,6 +40,7 @@
 import org.elasticsearch.common.Strings;
 import org.elasticsearch.common.geo.GeoDistance;
 import org.elasticsearch.common.geo.GeoPoint;
+import org.elasticsearch.common.geo.Orientation;
 import org.elasticsearch.common.geo.builders.*;
 import org.elasticsearch.index.query.*;
 import org.elasticsearch.search.aggregations.AggregationBuilder;
@@ -883,7 +884,7 @@ private PolygonBuilder createPolygonBuilder(Polygon polygon) {
         CoordinatesBuilder coordinatesBuilder = new CoordinatesBuilder();
         List<Coordinate> coordinates = Arrays.asList(polygon.getCoordinates());
         coordinatesBuilder.coordinates(coordinates);
-        return new PolygonBuilder(coordinatesBuilder, ShapeBuilder.Orientation.LEFT);
+        return new PolygonBuilder(coordinatesBuilder, Orientation.LEFT);
     }
 
     private PolygonBuilder createPolygonBuilder(double[] bbox) {
@@ -910,12 +911,12 @@ private PolygonBuilder createPolygonBuilder(double[] bbox) {
         coordinatesBuilder.coordinate(west, south);
         coordinatesBuilder.coordinate(east, south);
         // NB : In ES api LEFT is clockwise and RIGHT anticlockwise
-        return new PolygonBuilder(coordinatesBuilder, ShapeBuilder.Orientation.RIGHT);
+        return new PolygonBuilder(coordinatesBuilder, Orientation.RIGHT);
 
     }
 
     private MultiPolygonBuilder createMultiPolygonBuilder(MultiPolygon multiPolygon) {
-        MultiPolygonBuilder multiPolygonBuilder = new MultiPolygonBuilder(ShapeBuilder.Orientation.LEFT);
+        MultiPolygonBuilder multiPolygonBuilder = new MultiPolygonBuilder(Orientation.LEFT);
         for (int i = 0; i < multiPolygon.getNumGeometries(); i++) {
             multiPolygonBuilder.polygon(createPolygonBuilder((Polygon) multiPolygon.getGeometryN(i)));
         }
diff --git a/docker-compose-elasticsearch.yml b/docker-compose-elasticsearch.yml
index 613858aa7..ae5d20364 100644
--- a/docker-compose-elasticsearch.yml
+++ b/docker-compose-elasticsearch.yml
@@ -2,7 +2,7 @@ version: '3'
 
 services:
   elasticsearch:
-    image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION:-7.9.2}
+    image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION:-7.14.2}
     container_name: elasticsearch
     environment:
       - discovery.type=single-node
diff --git a/ogc-common/src/main/java/io/arlas/server/ogc/common/requestfilter/ElasticFilter.java b/ogc-common/src/main/java/io/arlas/server/ogc/common/requestfilter/ElasticFilter.java
index 10869ca3b..5c97bdf91 100644
--- a/ogc-common/src/main/java/io/arlas/server/ogc/common/requestfilter/ElasticFilter.java
+++ b/ogc-common/src/main/java/io/arlas/server/ogc/common/requestfilter/ElasticFilter.java
@@ -27,9 +27,9 @@
 import io.arlas.server.ogc.common.utils.OpenGISFieldsExtractor;
 import io.arlas.server.core.utils.BoundingBox;
 import io.arlas.server.core.utils.ColumnFilterUtil;
+import org.elasticsearch.common.geo.Orientation;
 import org.elasticsearch.common.geo.builders.CoordinatesBuilder;
 import org.elasticsearch.common.geo.builders.PolygonBuilder;
-import org.elasticsearch.common.geo.builders.ShapeBuilder;
 import org.elasticsearch.index.query.BoolQueryBuilder;
 import org.elasticsearch.index.query.Operator;
 import org.elasticsearch.index.query.QueryBuilders;
@@ -70,7 +70,7 @@ public static BoolQueryBuilder filter(String[] ids, String idFieldName, String q
             coordinatesBuilder.coordinate(boundingBox.getWest(), boundingBox.getNorth());
             coordinatesBuilder.coordinate(boundingBox.getWest(), boundingBox.getSouth());
             coordinatesBuilder.coordinate(boundingBox.getEast(), boundingBox.getSouth());
-            PolygonBuilder polygonBuilder = new PolygonBuilder(coordinatesBuilder, ShapeBuilder.Orientation.LEFT);
+            PolygonBuilder polygonBuilder = new PolygonBuilder(coordinatesBuilder, Orientation.LEFT);
             orBoolQueryBuilder = orBoolQueryBuilder
                     .should(QueryBuilders.geoIntersectionQuery(geometryField, polygonBuilder));
             minimumShouldMatch = minimumShouldMatch + 1;
diff --git a/pom.xml b/pom.xml
index ab91f68e9..62fde099b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -59,7 +59,7 @@
     <hazelcast.k8s.version>2.2.3</hazelcast.k8s.version>
 
     <!-- ELASTICSEARCH-->
-    <elastic.version>7.9.2</elastic.version>
+    <elastic.version>7.14.2</elastic.version>
     <elastic-apm.version>1.20.0</elastic-apm.version>
 
     <postgresql.version>42.2.19</postgresql.version>
diff --git a/release.sh b/release.sh
index 1bcebcf0a..0a0eb8814 100755
--- a/release.sh
+++ b/release.sh
@@ -93,7 +93,7 @@ case $i in
 esac
 done
 
-ELASTIC_VERSIONS_7=("7.0.1","7.1.0","7.2.1","7.3.2","7.4.2","7.5.2","7.6.2","7.7.1","7.8.1","7.9.2")
+ELASTIC_VERSIONS_7=("7.0.1","7.1.0","7.2.1","7.3.2","7.4.2","7.5.2","7.6.2","7.7.1","7.8.1","7.9.2","7.12.1","7.14.2")
 case $ELASTIC_RANGE in
     "7")
         ELASTIC_VERSIONS=( "${ELASTIC_VERSIONS_7[@]}" )


Test patch:
diff --git a/scripts/tests-integration-elasticsearch.sh b/scripts/tests-integration-elasticsearch.sh
index b4eb18a9e..7a3386140 100755
--- a/scripts/tests-integration-elasticsearch.sh
+++ b/scripts/tests-integration-elasticsearch.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-ELASTIC_RANGE=("7.0.1","7.1.0","7.2.1","7.3.2","7.4.2","7.5.2","7.6.2","7.7.1","7.8.1","7.9.2")
+ELASTIC_RANGE=("7.0.1","7.1.0","7.2.1","7.3.2","7.4.2","7.5.2","7.6.2","7.7.1","7.8.1","7.9.2","7.12.1","7.14.2")
 
 for i in "${ELASTIC_RANGE[@]}"
 do
diff --git a/scripts/tests-integration.sh b/scripts/tests-integration.sh
index 2bb9c5b0a..339cf2788 100755
--- a/scripts/tests-integration.sh
+++ b/scripts/tests-integration.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
 set -e
 
-export ELASTIC_VERSION="7.9.2"
+export ELASTIC_VERSION="7.14.2"
 
 function clean_exit {
   ARG=$?