Skip to content

Commit 7cf145c

Browse files
committed
Merge branch 'master' into retention-leases-version
* master: (36 commits) Ensure joda compatibility in custom date formats (elastic#38171) Do not compute cardinality if the `terms` execution mode does not use `global_ordinals` (elastic#38169) Do not set timeout for IndexRequests in GatewayIndexStateIT (elastic#38147) Zen2ify testMasterFailoverDuringIndexingWithMappingChanges (elastic#38178) SQL: [Docs] Add limitation for aggregate functions on scalars (elastic#38186) Add elasticsearch-node detach-cluster command (elastic#37979) Add tests for fractional epoch parsing (elastic#38162) Enable bw tests for elastic#37871 and elastic#38032. (elastic#38167) Clear send behavior rule in CloseWhileRelocatingShardsIT (elastic#38159) Fix testCorruptedIndex (elastic#38161) Add finalReduce flag to SearchRequest (elastic#38104) Forbid negative field boosts in analyzed queries (elastic#37930) Remove AtomiFieldData#getLegacyFieldValues (elastic#38087) Universal cluster bootstrap method for tests with autoMinMasterNodes=false (elastic#38038) Fix FullClusterRestartIT.testHistoryUUIDIsAdded (elastic#38098) Replace joda time in ingest-common module (elastic#38088) Fix eclipse config for ssl-config (elastic#38096) Don't load global ordinals with the `map` execution_hint (elastic#37833) Relax fault detector in some disruption tests (elastic#38101) Fix java time epoch date formatters (elastic#37829) ...
2 parents 73fb8f5 + 35ed137 commit 7cf145c

File tree

125 files changed

+4298
-1817
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+4298
-1817
lines changed

client/rest-high-level/src/main/java/org/elasticsearch/client/RestHighLevelClient.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@
9595
import org.elasticsearch.search.aggregations.bucket.filter.ParsedFilters;
9696
import org.elasticsearch.search.aggregations.bucket.geogrid.GeoHashGridAggregationBuilder;
9797
import org.elasticsearch.search.aggregations.bucket.geogrid.ParsedGeoHashGrid;
98+
import org.elasticsearch.search.aggregations.bucket.geogrid.ParsedGeoTileGrid;
99+
import org.elasticsearch.search.aggregations.bucket.geogrid.GeoTileGridAggregationBuilder;
98100
import org.elasticsearch.search.aggregations.bucket.global.GlobalAggregationBuilder;
99101
import org.elasticsearch.search.aggregations.bucket.global.ParsedGlobal;
100102
import org.elasticsearch.search.aggregations.bucket.histogram.AutoDateHistogramAggregationBuilder;
@@ -1760,6 +1762,7 @@ static List<NamedXContentRegistry.Entry> getDefaultNamedXContents() {
17601762
map.put(FilterAggregationBuilder.NAME, (p, c) -> ParsedFilter.fromXContent(p, (String) c));
17611763
map.put(InternalSampler.PARSER_NAME, (p, c) -> ParsedSampler.fromXContent(p, (String) c));
17621764
map.put(GeoHashGridAggregationBuilder.NAME, (p, c) -> ParsedGeoHashGrid.fromXContent(p, (String) c));
1765+
map.put(GeoTileGridAggregationBuilder.NAME, (p, c) -> ParsedGeoTileGrid.fromXContent(p, (String) c));
17631766
map.put(RangeAggregationBuilder.NAME, (p, c) -> ParsedRange.fromXContent(p, (String) c));
17641767
map.put(DateRangeAggregationBuilder.NAME, (p, c) -> ParsedDateRange.fromXContent(p, (String) c));
17651768
map.put(GeoDistanceAggregationBuilder.NAME, (p, c) -> ParsedGeoDistance.fromXContent(p, (String) c));

client/rest-high-level/src/test/java/org/elasticsearch/client/ClusterClientIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ public void testClusterHealthYellowClusterLevel() throws IOException {
182182
assertThat(response.getIndices().size(), equalTo(0));
183183
}
184184

185+
@AwaitsFix(bugUrl="https://github.com/elastic/elasticsearch/issues/35450")
185186
public void testClusterHealthYellowIndicesLevel() throws IOException {
186187
createIndex("index", Settings.EMPTY);
187188
createIndex("index2", Settings.EMPTY);
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
[[search-aggregations-bucket-geotilegrid-aggregation]]
2+
=== GeoTile Grid Aggregation
3+
4+
A multi-bucket aggregation that works on `geo_point` fields and groups points into
5+
buckets that represent cells in a grid. The resulting grid can be sparse and only
6+
contains cells that have matching data. Each cell corresponds to a
7+
https://en.wikipedia.org/wiki/Tiled_web_map[map tile] as used by many online map
8+
sites. Each cell is labeled using a "{zoom}/{x}/{y}" format, where zoom is equal
9+
to the user-specified precision.
10+
11+
* High precision keys have a larger range for x and y, and represent tiles that
12+
cover only a small area.
13+
* Low precision keys have a smaller range for x and y, and represent tiles that
14+
each cover a large area.
15+
16+
See https://wiki.openstreetmap.org/wiki/Zoom_levels[Zoom level documentation]
17+
on how precision (zoom) correlates to size on the ground. Precision for this
18+
aggregation can be between 0 and 29, inclusive.
19+
20+
WARNING: The highest-precision geotile of length 29 produces cells that cover
21+
less than a 10cm by 10cm of land and so high-precision requests can be very
22+
costly in terms of RAM and result sizes. Please see the example below on how
23+
to first filter the aggregation to a smaller geographic area before requesting
24+
high-levels of detail.
25+
26+
The specified field must be of type `geo_point` (which can only be set
27+
explicitly in the mappings) and it can also hold an array of `geo_point`
28+
fields, in which case all points will be taken into account during aggregation.
29+
30+
31+
==== Simple low-precision request
32+
33+
[source,js]
34+
--------------------------------------------------
35+
PUT /museums
36+
{
37+
"mappings": {
38+
"properties": {
39+
"location": {
40+
"type": "geo_point"
41+
}
42+
}
43+
}
44+
}
45+
46+
POST /museums/_bulk?refresh
47+
{"index":{"_id":1}}
48+
{"location": "52.374081,4.912350", "name": "NEMO Science Museum"}
49+
{"index":{"_id":2}}
50+
{"location": "52.369219,4.901618", "name": "Museum Het Rembrandthuis"}
51+
{"index":{"_id":3}}
52+
{"location": "52.371667,4.914722", "name": "Nederlands Scheepvaartmuseum"}
53+
{"index":{"_id":4}}
54+
{"location": "51.222900,4.405200", "name": "Letterenhuis"}
55+
{"index":{"_id":5}}
56+
{"location": "48.861111,2.336389", "name": "Musée du Louvre"}
57+
{"index":{"_id":6}}
58+
{"location": "48.860000,2.327000", "name": "Musée d'Orsay"}
59+
60+
POST /museums/_search?size=0
61+
{
62+
"aggregations" : {
63+
"large-grid" : {
64+
"geotile_grid" : {
65+
"field" : "location",
66+
"precision" : 8
67+
}
68+
}
69+
}
70+
}
71+
--------------------------------------------------
72+
// CONSOLE
73+
74+
Response:
75+
76+
[source,js]
77+
--------------------------------------------------
78+
{
79+
...
80+
"aggregations": {
81+
"large-grid": {
82+
"buckets": [
83+
{
84+
"key" : "8/131/84",
85+
"doc_count" : 3
86+
},
87+
{
88+
"key" : "8/129/88",
89+
"doc_count" : 2
90+
},
91+
{
92+
"key" : "8/131/85",
93+
"doc_count" : 1
94+
}
95+
]
96+
}
97+
}
98+
}
99+
--------------------------------------------------
100+
// TESTRESPONSE[s/\.\.\./"took": $body.took,"_shards": $body._shards,"hits":$body.hits,"timed_out":false,/]
101+
102+
==== High-precision requests
103+
104+
When requesting detailed buckets (typically for displaying a "zoomed in" map)
105+
a filter like <<query-dsl-geo-bounding-box-query,geo_bounding_box>> should be
106+
applied to narrow the subject area otherwise potentially millions of buckets
107+
will be created and returned.
108+
109+
[source,js]
110+
--------------------------------------------------
111+
POST /museums/_search?size=0
112+
{
113+
"aggregations" : {
114+
"zoomed-in" : {
115+
"filter" : {
116+
"geo_bounding_box" : {
117+
"location" : {
118+
"top_left" : "52.4, 4.9",
119+
"bottom_right" : "52.3, 5.0"
120+
}
121+
}
122+
},
123+
"aggregations":{
124+
"zoom1":{
125+
"geotile_grid" : {
126+
"field": "location",
127+
"precision": 22
128+
}
129+
}
130+
}
131+
}
132+
}
133+
}
134+
--------------------------------------------------
135+
// CONSOLE
136+
// TEST[continued]
137+
138+
[source,js]
139+
--------------------------------------------------
140+
{
141+
...
142+
"aggregations" : {
143+
"zoomed-in" : {
144+
"doc_count" : 3,
145+
"zoom1" : {
146+
"buckets" : [
147+
{
148+
"key" : "22/2154412/1378379",
149+
"doc_count" : 1
150+
},
151+
{
152+
"key" : "22/2154385/1378332",
153+
"doc_count" : 1
154+
},
155+
{
156+
"key" : "22/2154259/1378425",
157+
"doc_count" : 1
158+
}
159+
]
160+
}
161+
}
162+
}
163+
}
164+
--------------------------------------------------
165+
// TESTRESPONSE[s/\.\.\./"took": $body.took,"_shards": $body._shards,"hits":$body.hits,"timed_out":false,/]
166+
167+
168+
==== Options
169+
170+
[horizontal]
171+
field:: Mandatory. The name of the field indexed with GeoPoints.
172+
173+
precision:: Optional. The integer zoom of the key used to define
174+
cells/buckets in the results. Defaults to 7.
175+
Values outside of [0,29] will be rejected.
176+
177+
size:: Optional. The maximum number of geohash buckets to return
178+
(defaults to 10,000). When results are trimmed, buckets are
179+
prioritised based on the volumes of documents they contain.
180+
181+
shard_size:: Optional. To allow for more accurate counting of the top cells
182+
returned in the final result the aggregation defaults to
183+
returning `max(10,(size x number-of-shards))` buckets from each
184+
shard. If this heuristic is undesirable, the number considered
185+
from each shard can be over-ridden using this parameter.

docs/reference/ingest/processors/user-agent.asciidoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ Which returns
6767
"version": "10.10.5",
6868
"full": "Mac OS X 10.10.5"
6969
},
70-
"device": "Other"
70+
"device" : {
71+
"name" : "Other"
72+
},
7173
}
7274
}
7375
}

0 commit comments

Comments
 (0)