Skip to content

Commit 7ea7e2f

Browse files
Update histogram-aggregation docs (#96974) (#97151)
* Update histogram-aggregation * Little tweak * Update docs/reference/aggregations/bucket/histogram-aggregation.asciidoc Co-authored-by: Abdon Pijpelink <[email protected]> * Update docs/reference/aggregations/bucket/histogram-aggregation.asciidoc Co-authored-by: Abdon Pijpelink <[email protected]> * Add test --------- Co-authored-by: Abdon Pijpelink <[email protected]> (cherry picked from commit 4ccc5a9) Co-authored-by: Philipp Kahr <[email protected]>
1 parent 93a7293 commit 7ea7e2f

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

docs/reference/aggregations/bucket/histogram-aggregation.asciidoc

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,25 @@ with latency metrics (in milliseconds) for different networks:
332332

333333
[source,console]
334334
--------------------------------------------------
335-
PUT metrics_index/_doc/1
335+
PUT metrics_index
336+
{
337+
"mappings": {
338+
"properties": {
339+
"network": {
340+
"properties": {
341+
"name": {
342+
"type": "keyword"
343+
}
344+
}
345+
},
346+
"latency_histo": {
347+
"type": "histogram"
348+
}
349+
}
350+
}
351+
}
352+
353+
PUT metrics_index/_doc/1?refresh
336354
{
337355
"network.name" : "net-1",
338356
"latency_histo" : {
@@ -341,7 +359,7 @@ PUT metrics_index/_doc/1
341359
}
342360
}
343361
344-
PUT metrics_index/_doc/2
362+
PUT metrics_index/_doc/2?refresh
345363
{
346364
"network.name" : "net-2",
347365
"latency_histo" : {
@@ -372,7 +390,7 @@ return the following output:
372390
{
373391
...
374392
"aggregations": {
375-
"prices": {
393+
"latency_buckets": {
376394
"buckets": [
377395
{
378396
"key": 0.0,
@@ -395,7 +413,7 @@ return the following output:
395413
}
396414
}
397415
--------------------------------------------------
398-
// TESTRESPONSE[skip:test not setup]
416+
// TESTRESPONSE[s/\.\.\./"took": $body.took,"timed_out": false,"_shards": $body._shards,"hits": $body.hits,/]
399417

400418
[IMPORTANT]
401419
========

0 commit comments

Comments
 (0)