diff --git a/src/main/java/org/springframework/data/elasticsearch/core/CriteriaFilterProcessor.java b/src/main/java/org/springframework/data/elasticsearch/core/CriteriaFilterProcessor.java index 0d2cdc9e7..45f42d880 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/CriteriaFilterProcessor.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/CriteriaFilterProcessor.java @@ -16,7 +16,7 @@ package org.springframework.data.elasticsearch.core; import org.elasticsearch.index.query.*; -import org.springframework.data.elasticsearch.core.geo.GeoEnvelope; +import org.springframework.data.elasticsearch.core.geo.GeoBox; import org.springframework.data.elasticsearch.core.geo.GeoPoint; import org.springframework.data.elasticsearch.core.query.Criteria; import org.springframework.util.Assert; @@ -152,8 +152,8 @@ class CriteriaFilterProcessor { } private void oneParameterBBox(GeoBoundingBoxFilterBuilder filter, Object value) { - Assert.isTrue(value instanceof GeoEnvelope, "single-element of a geo bbox filter must be type of GeoEnvelop"); - GeoEnvelope geoBBox = (GeoEnvelope) value; + Assert.isTrue(value instanceof GeoBox, "single-element of a geo bbox filter must be type of GeoEnvelop"); + GeoBox geoBBox = (GeoBox) value; filter.topLeft(geoBBox.getTopLeft().getLat(), geoBBox.getTopLeft().getLon()); filter.bottomRight(geoBBox.getBottomRight().getLat(), geoBBox.getBottomRight().getLon()); } diff --git a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoEnvelope.java b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoBox.java similarity index 92% rename from src/main/java/org/springframework/data/elasticsearch/core/geo/GeoEnvelope.java rename to src/main/java/org/springframework/data/elasticsearch/core/geo/GeoBox.java index 16c00f248..c8317b094 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoEnvelope.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoBox.java @@ -20,12 +20,12 @@ package org.springframework.data.elasticsearch.core.geo; * * @author Franck Marchand */ -public class GeoEnvelope { +public class GeoBox { private GeoPoint topLeft; private GeoPoint bottomRight; - public GeoEnvelope(GeoPoint topLeft, GeoPoint bottomRight) { + public GeoBox(GeoPoint topLeft, GeoPoint bottomRight) { this.topLeft = topLeft; this.bottomRight = bottomRight; } diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java b/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java index 42bc08712..c46cb8e84 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java @@ -25,7 +25,7 @@ import java.util.Set; import org.apache.commons.lang.StringUtils; import org.springframework.dao.InvalidDataAccessApiUsageException; -import org.springframework.data.elasticsearch.core.geo.GeoEnvelope; +import org.springframework.data.elasticsearch.core.geo.GeoBox; import org.springframework.data.elasticsearch.core.geo.GeoPoint; import org.springframework.util.Assert; @@ -387,10 +387,10 @@ public class Criteria { /** * Creates new CriteriaEntry for {@code location BBOX bounding box} * - * @param bbox {@link org.springframework.data.elasticsearch.core.geo.GeoEnvelope} bounding box(left top corner + right bottom corner) + * @param bbox {@link org.springframework.data.elasticsearch.core.geo.GeoBox} bounding box(left top corner + right bottom corner) * @return Criteria the chaind criteria with the new 'bbox' criteria included. */ - public Criteria bbox(GeoEnvelope bbox) { + public Criteria bbox(GeoBox bbox) { Assert.notNull(bbox, "bbox value for bbox criteria must not be null"); filterCriteria.add(new CriteriaEntry(OperationKey.BBOX, new Object[]{bbox})); return this; diff --git a/src/test/java/org/springframework/data/elasticsearch/core/geo/ElasticsearchTemplateGeoTests.java b/src/test/java/org/springframework/data/elasticsearch/core/geo/ElasticsearchTemplateGeoTests.java index 1d22b4bfc..133f2ba6f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/geo/ElasticsearchTemplateGeoTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/geo/ElasticsearchTemplateGeoTests.java @@ -191,7 +191,7 @@ public class ElasticsearchTemplateGeoTests { loadClassBaseEntities(); CriteriaQuery geoLocationCriteriaQuery3 = new CriteriaQuery( new Criteria("location").bbox( - new GeoEnvelope(new GeoPoint(53.5171d, 0), + new GeoBox(new GeoPoint(53.5171d, 0), new GeoPoint(49.5171d, 0.2062d)))); //when List geoAuthorsForGeoCriteria3 = elasticsearchTemplate.queryForList(geoLocationCriteriaQuery3, AuthorMarkerEntity.class);