Skip to content

Commit

Permalink
Refactor metric aggregation section (#4543)
Browse files Browse the repository at this point in the history
* Refactor metric aggregation section

Signed-off-by: Fanit Kolchina <[email protected]>

* Update _query-dsl/aggregations/metric/matrix-stats.md

Co-authored-by: Naarcha-AWS <[email protected]>
Signed-off-by: kolchfa-aws <[email protected]>

* Update _query-dsl/aggregations/metric/extended-stats.md

Co-authored-by: Naarcha-AWS <[email protected]>
Signed-off-by: kolchfa-aws <[email protected]>

---------

Signed-off-by: Fanit Kolchina <[email protected]>
Signed-off-by: kolchfa-aws <[email protected]>
Co-authored-by: Naarcha-AWS <[email protected]>
  • Loading branch information
kolchfa-aws and Naarcha-AWS committed Jul 12, 2023
1 parent 3567e8b commit 02f40d7
Show file tree
Hide file tree
Showing 38 changed files with 964 additions and 638 deletions.
1 change: 1 addition & 0 deletions _query-dsl/aggregations/bucket/adjacency-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ GET opensearch_dashboards_sample_data_ecommerce/_search
}
}
```
{% include copy-curl.html %}

#### Example response

Expand Down
1 change: 1 addition & 0 deletions _query-dsl/aggregations/bucket/date-histogram.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ GET opensearch_dashboards_sample_data_logs/_search
}
}
```
{% include copy-curl.html %}

#### Example response

Expand Down
1 change: 1 addition & 0 deletions _query-dsl/aggregations/bucket/date-range.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ GET opensearch_dashboards_sample_data_logs/_search
}
}
```
{% include copy-curl.html %}

#### Example response

Expand Down
1 change: 1 addition & 0 deletions _query-dsl/aggregations/bucket/diversified-sampler.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ GET opensearch_dashboards_sample_data_logs/_search
}
}
```
{% include copy-curl.html %}

#### Example response

Expand Down
1 change: 1 addition & 0 deletions _query-dsl/aggregations/bucket/filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ GET opensearch_dashboards_sample_data_ecommerce/_search
}
}
```
{% include copy-curl.html %}

#### Example response

Expand Down
1 change: 1 addition & 0 deletions _query-dsl/aggregations/bucket/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ GET opensearch_dashboards_sample_data_logs/_search
}
}
```
{% include copy-curl.html %}

#### Example response

Expand Down
1 change: 1 addition & 0 deletions _query-dsl/aggregations/bucket/geo-distance.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ GET opensearch_dashboards_sample_data_logs/_search
}
}
```
{% include copy-curl.html %}

#### Example response

Expand Down
1 change: 1 addition & 0 deletions _query-dsl/aggregations/bucket/geohash-grid.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ GET opensearch_dashboards_sample_data_logs/_search
}
}
```
{% include copy-curl.html %}

#### Example response

Expand Down
12 changes: 12 additions & 0 deletions _query-dsl/aggregations/bucket/geohex-grid.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ PUT national_parks
}
}
```
{% include copy-curl.html %}

Index the following documents into the sample index:

Expand All @@ -46,19 +47,26 @@ PUT national_parks/_doc/1
"name": "Yellowstone National Park",
"location": "44.42, -110.59"
}
```
{% include copy-curl.html %}

```json
PUT national_parks/_doc/2
{
"name": "Yosemite National Park",
"location": "37.87, -119.53"
}
```
{% include copy-curl.html %}

```json
PUT national_parks/_doc/3
{
"name": "Death Valley National Park",
"location": "36.53, -116.93"
}
```
{% include copy-curl.html %}

You can index geopoints in several formats. For a list of all supported formats, see the [geopoint documentation]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/geo-point#formats).
{: .note}
Expand All @@ -80,6 +88,7 @@ GET national_parks/_search
}
}
```
{% include copy-curl.html %}

You can use either the `GET` or `POST` HTTP method for geohex grid aggregation queries.
{: .note}
Expand Down Expand Up @@ -166,6 +175,7 @@ GET national_parks/_search
}
}
```
{% include copy-curl.html %}

All three documents are bucketed separately because of higher granularity:

Expand Down Expand Up @@ -266,6 +276,7 @@ GET national_parks/_search
}
}
```
{% include copy-curl.html %}

The response contains the two documents that are within the `geo_bounding_box` bounds:

Expand Down Expand Up @@ -327,6 +338,7 @@ GET national_parks/_search
}
}
```
{% include copy-curl.html %}

The response contains only the two results that are within the specified bounds:

Expand Down
11 changes: 11 additions & 0 deletions _query-dsl/aggregations/bucket/geotile-grid.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ PUT national_parks
}
}
```
{% include copy-curl.html %}

Index the following documents into the sample index:

Expand All @@ -39,19 +40,26 @@ PUT national_parks/_doc/1
"name": "Yellowstone National Park",
"location": "44.42, -110.59"
}
```
{% include copy-curl.html %}

```json
PUT national_parks/_doc/2
{
"name": "Yosemite National Park",
"location": "37.87, -119.53"
}
```
{% include copy-curl.html %}

```json
PUT national_parks/_doc/3
{
"name": "Death Valley National Park",
"location": "36.53, -116.93"
}
```
{% include copy-curl.html %}

You can index geopoints in several formats. For a list of all supported formats, see the [geopoint documentation]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/geo-point#formats).
{: .note}
Expand All @@ -73,6 +81,7 @@ GET national_parks/_search
}
}
```
{% include copy-curl.html %}

You can use either the `GET` or `POST` HTTP method for geotile grid aggregation queries.
{: .note}
Expand Down Expand Up @@ -155,6 +164,7 @@ GET national_parks/_search
}
}
```
{% include copy-curl.html %}

All three documents are bucketed separately because of higher granularity:

Expand Down Expand Up @@ -245,6 +255,7 @@ GET national_parks/_search
}
}
```
{% include copy-curl.html %}

The response contains only the two results that are within the specified bounds:

Expand Down
1 change: 1 addition & 0 deletions _query-dsl/aggregations/bucket/global.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ GET opensearch_dashboards_sample_data_ecommerce/_search
}
}
```
{% include copy-curl.html %}

#### Example response

Expand Down
1 change: 1 addition & 0 deletions _query-dsl/aggregations/bucket/histogram.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ GET opensearch_dashboards_sample_data_logs/_search
}
}
```
{% include copy-curl.html %}

#### Example response

Expand Down
1 change: 1 addition & 0 deletions _query-dsl/aggregations/bucket/ip-range.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ GET opensearch_dashboards_sample_data_logs/_search
}
}
```
{% include copy-curl.html %}

#### Example response

Expand Down
1 change: 1 addition & 0 deletions _query-dsl/aggregations/bucket/missing.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ GET opensearch_dashboards_sample_data_logs/_search
}
}
```
{% include copy-curl.html %}

Because the default value for the `min_doc_count` parameter is 1, the `missing` parameter doesn't return any buckets in its response. Set `min_doc_count` parameter to 0 to see the "N/A" bucket in the response:

Expand Down
1 change: 1 addition & 0 deletions _query-dsl/aggregations/bucket/multi-terms.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ GET sample-index100/_search
}
}
```
{% include copy-curl.html %}

#### Example response

Expand Down
3 changes: 3 additions & 0 deletions _query-dsl/aggregations/bucket/nested.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ PUT logs/_doc/0
]
}
```
{% include copy-curl.html %}

OpenSearch merges all sub-properties of the entity relations that looks something like this:

Expand Down Expand Up @@ -60,6 +61,7 @@ PUT logs
}
}
```
{% include copy-curl.html %}

Nested documents allow you to index the same JSON document but will keep your pages in separate Lucene documents, making only searches like `pages=landing` and `load_time=200` return the expected result. Internally, nested objects index each object in the array as a separate hidden document, meaning that each nested object can be queried independently of the others.

Expand All @@ -84,6 +86,7 @@ GET logs/_search
}
}
```
{% include copy-curl.html %}

#### Example response

Expand Down
1 change: 1 addition & 0 deletions _query-dsl/aggregations/bucket/range.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ GET opensearch_dashboards_sample_data_logs/_search
}
}
```
{% include copy-curl.html %}

The response includes the `from` key values and excludes the `to` key values:

Expand Down
1 change: 1 addition & 0 deletions _query-dsl/aggregations/bucket/reverse-nested.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ GET logs/_search
}
}
```
{% include copy-curl.html %}

#### Example response

Expand Down
1 change: 1 addition & 0 deletions _query-dsl/aggregations/bucket/sampler.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ GET opensearch_dashboards_sample_data_logs/_search
}
}
```
{% include copy-curl.html %}

#### Example response

Expand Down
1 change: 1 addition & 0 deletions _query-dsl/aggregations/bucket/significant-terms.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ GET opensearch_dashboards_sample_data_logs/_search
}
}
```
{% include copy-curl.html %}

#### Example response

Expand Down
1 change: 1 addition & 0 deletions _query-dsl/aggregations/bucket/significant-text.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ GET shakespeare/_search
}
}
```
{% include copy-curl.html %}

#### Example response

Expand Down
1 change: 1 addition & 0 deletions _query-dsl/aggregations/bucket/terms.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ GET opensearch_dashboards_sample_data_logs/_search
}
}
```
{% include copy-curl.html %}

#### Example response

Expand Down
Loading

0 comments on commit 02f40d7

Please sign in to comment.