mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 15:17:30 -04:00
This commit moves the legacy geo_shape implementation to its own module and removes the dependency on Spatial4J / JTS from server.
This commit is contained in:
parent
ca5480b9a8
commit
82dc997010
81 changed files with 5634 additions and 3780 deletions
|
@ -11,9 +11,9 @@ package org.elasticsearch.client.documentation;
|
|||
import org.apache.lucene.search.join.ScoreMode;
|
||||
import org.elasticsearch.common.geo.GeoPoint;
|
||||
import org.elasticsearch.common.geo.ShapeRelation;
|
||||
import org.elasticsearch.common.geo.builders.CoordinatesBuilder;
|
||||
import org.elasticsearch.common.geo.builders.MultiPointBuilder;
|
||||
import org.elasticsearch.common.unit.DistanceUnit;
|
||||
import org.elasticsearch.geometry.MultiPoint;
|
||||
import org.elasticsearch.geometry.Point;
|
||||
import org.elasticsearch.index.query.GeoShapeQueryBuilder;
|
||||
import org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder;
|
||||
import org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder;
|
||||
|
@ -178,16 +178,16 @@ public class QueryDSLDocumentationTests extends ESTestCase {
|
|||
public void testGeoShape() throws IOException {
|
||||
{
|
||||
// tag::geo_shape
|
||||
List<Point> points = new ArrayList<>();
|
||||
points.add(new Point(0, 0));
|
||||
points.add(new Point(0, 10));
|
||||
points.add(new Point(10, 10));
|
||||
points.add(new Point(10, 0));
|
||||
points.add(new Point(0, 0));
|
||||
GeoShapeQueryBuilder qb = geoShapeQuery(
|
||||
"pin.location", // <1>
|
||||
new MultiPointBuilder( // <2>
|
||||
new CoordinatesBuilder()
|
||||
.coordinate(0, 0)
|
||||
.coordinate(0, 10)
|
||||
.coordinate(10, 10)
|
||||
.coordinate(10, 0)
|
||||
.coordinate(0, 0)
|
||||
.build()));
|
||||
"pin.location", // <1>
|
||||
new MultiPoint(points) // <2>
|
||||
);
|
||||
qb.relation(ShapeRelation.WITHIN); // <3>
|
||||
// end::geo_shape
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue