Skip to content

Commit 5a9e607

Browse files
committed
deploy: 2923836
1 parent 62b1d8e commit 5a9e607

File tree

3 files changed

+42
-25
lines changed

3 files changed

+42
-25
lines changed

manual/Aggregations.md

+20-3
Original file line numberDiff line numberDiff line change
@@ -333,17 +333,30 @@ client.bulk(target = indexName) {
333333
The main bucket aggregation for geo spatial information is the `geotile_grid` aggregation:
334334

335335
```kotlin
336-
client.search(indexName) {
336+
val response = client.search(indexName) {
337337
resultSize = 0
338338
agg("grid", GeoTileGridAgg(TestGeoDoc::point.name,13)) {
339339
agg("centroid", GeoCentroidAgg(TestGeoDoc::point.name))
340340
}
341341
}
342+
343+
println(
344+
DEFAULT_PRETTY_JSON.encodeToString(response)
345+
)
346+
val geoTiles = response.aggregations.geoTileGridResult("grid")
347+
geoTiles.parsedBuckets.forEach { bucket ->
348+
bucket.aggregations.geoCentroid("centroid").let {
349+
val key = bucket.parsed.key
350+
println("$key: ${it.location} - ${it.count} ")
351+
}
352+
}
342353
```
343354

344-
```json
355+
This prints:
356+
357+
```text
345358
{
346-
"took": 15,
359+
"took": 11,
347360
"_shards": {
348361
"total": 1,
349362
"successful": 1,
@@ -409,6 +422,10 @@ client.search(indexName) {
409422
}
410423
}
411424
}
425+
13/4400/2686: Point(lat=52.52330794930458, lon=13.38908314704895) - 2
426+
13/4403/2692: Point(lat=52.36703671049327, lon=13.517282847315073) - 1
427+
13/4401/2686: Point(lat=52.52082384657115, lon=13.409421667456627) - 1
428+
13/4398/2685: Point(lat=52.55955611821264, lon=13.292043171823025) - 1
412429
```
413430

414431
## Other aggregations

manual/Highlighting.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ client.search(indexName) {
8080
```
8181

8282
{
83-
"took": 16,
83+
"took": 12,
8484
"_shards": {
8585
"total": 1,
8686
"successful": 1,

manual/KnnSearch.md

+21-21
Original file line numberDiff line numberDiff line change
@@ -133,39 +133,39 @@ This prints:
133133

134134
```text
135135
query for vector of rice:
136-
CYoTuZQBGXA3GUEriBm9 - 0.93660545: chicken
137-
B4oTuZQBGXA3GUEriBm9 - 0.9159527: chicken teriyaki with rice
138-
A4oTuZQBGXA3GUEriBm9 - 0.91181946: apple pie
136+
svkkvJQBNtyT1P5_ZeRz - 0.93660545: chicken
137+
sPkkvJQBNtyT1P5_ZeRz - 0.9159527: chicken teriyaki with rice
138+
rPkkvJQBNtyT1P5_ZeRz - 0.91181946: apple pie
139139
---
140140
query for vector of gebak en taart:
141-
A4oTuZQBGXA3GUEriBm9 - 0.8899498: apple pie
142-
CIoTuZQBGXA3GUEriBm9 - 0.8890915: tikka massala
143-
BooTuZQBGXA3GUEriBm9 - 0.88838005: pattiserie
141+
rPkkvJQBNtyT1P5_ZeRz - 0.8899498: apple pie
142+
sfkkvJQBNtyT1P5_ZeRz - 0.8890915: tikka massala
143+
r_kkvJQBNtyT1P5_ZeRz - 0.88838005: pattiserie
144144
---
145145
query for vector of muppets:
146-
A4oTuZQBGXA3GUEriBm9 - 0.9113884: apple pie
147-
CYoTuZQBGXA3GUEriBm9 - 0.90841866: chicken
148-
BYoTuZQBGXA3GUEriBm9 - 0.90057564: the cookie monster
146+
rPkkvJQBNtyT1P5_ZeRz - 0.9113884: apple pie
147+
svkkvJQBNtyT1P5_ZeRz - 0.90841866: chicken
148+
rvkkvJQBNtyT1P5_ZeRz - 0.90057564: the cookie monster
149149
---
150150
query for vector of artisanal baker:
151-
BIoTuZQBGXA3GUEriBm9 - 0.9066143: chocolate chip cookie
152-
BYoTuZQBGXA3GUEriBm9 - 0.89697075: the cookie monster
153-
AYoTuZQBGXA3GUEriBm9 - 0.8922405: banana muffin with chocolate chips
151+
rfkkvJQBNtyT1P5_ZeRz - 0.9066143: chocolate chip cookie
152+
rvkkvJQBNtyT1P5_ZeRz - 0.89697075: the cookie monster
153+
qvkkvJQBNtyT1P5_ZeRz - 0.8922405: banana muffin with chocolate chips
154154
---
155155
query for vector of indian curry:
156-
CYoTuZQBGXA3GUEriBm9 - 0.9322586: chicken
157-
B4oTuZQBGXA3GUEriBm9 - 0.9312973: chicken teriyaki with rice
158-
CIoTuZQBGXA3GUEriBm9 - 0.9182453: tikka massala
156+
svkkvJQBNtyT1P5_ZeRz - 0.9322586: chicken
157+
sPkkvJQBNtyT1P5_ZeRz - 0.9312973: chicken teriyaki with rice
158+
sfkkvJQBNtyT1P5_ZeRz - 0.9182453: tikka massala
159159
---
160160
query for vector of japanese food:
161-
B4oTuZQBGXA3GUEriBm9 - 0.92860985: chicken teriyaki with rice
162-
CYoTuZQBGXA3GUEriBm9 - 0.9264393: chicken
163-
A4oTuZQBGXA3GUEriBm9 - 0.9177284: apple pie
161+
sPkkvJQBNtyT1P5_ZeRz - 0.92860985: chicken teriyaki with rice
162+
svkkvJQBNtyT1P5_ZeRz - 0.9264393: chicken
163+
rPkkvJQBNtyT1P5_ZeRz - 0.9177284: apple pie
164164
---
165165
query for vector of baked goods:
166-
A4oTuZQBGXA3GUEriBm9 - 0.9216957: apple pie
167-
BIoTuZQBGXA3GUEriBm9 - 0.91723824: chocolate chip cookie
168-
AooTuZQBGXA3GUEriBm9 - 0.91052055: apple crumble
166+
rPkkvJQBNtyT1P5_ZeRz - 0.9216957: apple pie
167+
rfkkvJQBNtyT1P5_ZeRz - 0.91723824: chocolate chip cookie
168+
q_kkvJQBNtyT1P5_ZeRz - 0.91052055: apple crumble
169169
---
170170
```
171171

0 commit comments

Comments
 (0)