mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-07-01 08:12:11 +00:00
Renamed GeoEnvelope to GeoBox
This commit is contained in:
parent
714bcf87fe
commit
bb81fa75db
@ -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());
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
@ -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;
|
||||
|
@ -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<AuthorMarkerEntity> geoAuthorsForGeoCriteria3 = elasticsearchTemplate.queryForList(geoLocationCriteriaQuery3, AuthorMarkerEntity.class);
|
||||
|
Loading…
x
Reference in New Issue
Block a user