Skip to content

Commit

Permalink
Updating integration tests
Browse files Browse the repository at this point in the history
-with a larger query shape covering
 the whole documents.
  • Loading branch information
sreekanth-cb committed Apr 25, 2022
1 parent 63a2b97 commit 1735fdc
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
7 changes: 7 additions & 0 deletions search/searcher/search_geoshape_polygon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,13 @@ func TestGeoJsonPolygonWithInQuery(t *testing.T) {
{8.516979217529295, 47.38733837470806}, {8.522472381591797, 47.38794853343167},
{8.516507148742676, 47.388994503382285}, {8.515305519104004, 47.392597129887}}},
"geometry", nil},

// test with query polygon for all the shapes.
{[][][]float64{{{-135.0, -38.0},
{149.0, -38.0}, {149.0, 77.0}, {-135.0, 77.0}}},
"geometry", []string{"polygon1", "polygon2", "polygon3", "envelope1", "circle1", "linestring1",
"linestring2", "linestring3", "multilinestring1", "multilinestring2", "multipoint1",
"polygonWithHole1", "polygon4", "multipolygon1"}},
}

i := setupGeoJsonShapesIndexForPolygonQuery(t)
Expand Down
64 changes: 64 additions & 0 deletions test/tests/geoshapes/searches.json
Original file line number Diff line number Diff line change
Expand Up @@ -1432,5 +1432,69 @@
}
]
}
},
{
"comment": "search a polygon(almost the whole earth surface) that contains every indexed shape",
"search": {
"from": 0,
"size": 10,
"query": {
"geometry": {
"shape": {
"type": "polygon",
"coordinates": [
[
[
-135.0, -38.0
],
[
149.0, -38.0
],
[
149.0, 77.0
],
[
-135.0, 77.0
]
]
]
},
"relation": "within"
}
},
"sort": ["-_id"]
},
"result": {
"total_hits": 9,
"hits": [
{
"id": "polygon_cubbonpark"
},
{
"id": "point_museum_of_london"
},
{
"id": "multipolygon_london_parks"
},
{
"id": "multipoint_blr_stadiums"
},
{
"id": "multilinestring_old_airport_road"
},
{
"id": "linestring_putney_bridge"
},
{
"id": "geometrycollection_tvm"
},
{
"id": "envelope_brockwell_park"
},
{
"id": "circle_halairport"
}
]
}
}
]

0 comments on commit 1735fdc

Please sign in to comment.