Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
nateynateynate committed May 31, 2024
2 parents 9861440 + 7c4fe91 commit 237737b
Show file tree
Hide file tree
Showing 118 changed files with 3,491 additions and 308 deletions.
2 changes: 2 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ _Describe what this change achieves._
### Issues Resolved
_List any issues this PR will resolve, e.g. Closes [...]._

### Version
_List the OpenSearch version to which this PR applies, e.g. 2.14, 2.12--2.14, or all._

### Checklist
- [ ] By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and subject to the [Developers Certificate of Origin](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).
Expand Down
2 changes: 2 additions & 0 deletions .github/vale/styles/OpenSearch/DashSpacing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ message: "There should be no spaces around the dash in '%s'."
ignorecase: true
nonword: true
level: error
scope:
- ~list
tokens:
- '\w+ +-{2,3} +\w+'
4 changes: 4 additions & 0 deletions .github/vale/tests/test-style-neg.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ This sentence tests cybersecurity.

This sentence tests dash---spacing.

This sentence tests:

- Dash --- spacing in a list.

This sentence tests numbers above 1.2 in versions 1.2 and earlier.

This sentence tests upper-right and lower left.
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ This project has adopted an [Open Source Code of Conduct](https://opensearch.org

## Security

If you discover a potential security issue in this project, we ask that you notify AWS/Amazon Security using our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Do **not** create a public GitHub issue.

If you discover a potential security issue in this project, notify OpenSearch Security directly by emailing [email protected]. To prevent any additional risk caused by the potential issue, do **not** create a public GitHub issue.

## License

Expand Down
80 changes: 41 additions & 39 deletions STYLE_GUIDE.md

Large diffs are not rendered by default.

76 changes: 38 additions & 38 deletions TERMS.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions _about/version-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ permalink: /version-history/

OpenSearch version | Release highlights | Release date
:--- | :--- | :---
[2.14.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.14.0.md) | Includes performance improvements to hybrid search and date histogram queries with multi-range traversal, ML model integration within the Ingest API, semantic cache for LangChain applications, low-level vector query interface for neural sparse queries, and improved k-NN search filtering. Provides an experimental tiered cache feature. For a full list of release highlights, see the Release Notes. | 14 May 2024
[2.13.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.13.0.md) | Makes agents and tools and the OpenSearch Assistant Toolkit generally available. Introduces vector quantization within OpenSearch. Adds LLM guardrails and hybrid search with aggregations. Adds the Bloom filter skipping index for Apache Spark data sources, I/O-based admission control, and the ability to add an alerting cluster that manages all alerting tasks. For a full list of release highlights, see the Release Notes. | 2 April 2024
[2.12.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.12.0.md) | Makes concurrent segment search and conversational search generally available. Provides an experimental OpenSearch Assistant Toolkit, including agents and tools, workflow automation, and OpenSearch Assistant for OpenSearch Dashboards UI. Adds a new match-only text field, query insights to monitor top N queries, and k-NN search on nested fields. For a full list of release highlights, see the Release Notes. | 20 February 2024
[2.11.1](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.11.1.md) | Includes maintenance changes and bug fixes for cross-cluster replication, alerting, observability, OpenSearch Dashboards, index management, machine learning, security, and security analytics. For a full list of release highlights, see the Release Notes. | 30 November 2023
Expand Down
35 changes: 33 additions & 2 deletions _aggregations/bucket/multi-terms.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,15 @@ GET sample-index100/_search
},{
"field": "host"
}],
"order": {"max-cpu": "desc"}
"order": [{
"max-cpu": "desc"
},{
"max-memory": "desc"
}]
},
"aggs": {
"max-cpu": { "max": { "field": "cpu" } }
"max-cpu": { "max": { "field": "cpu" } },
"max-memory": { "max": { "field": "memory" } }
}
}
}
Expand Down Expand Up @@ -83,6 +88,23 @@ GET sample-index100/_search
"doc_count": 2,
"max-cpu": {
"value": 90.0
},
"max-memory": {
"value": 50.0
}
},
{
"key": [
"dub1",
"h1"
],
"key_as_string": "dub|h1",
"doc_count": 2,
"max-cpu": {
"value": 90.0
},
"max-memory": {
"value": 40.0
}
},
{
Expand All @@ -94,6 +116,9 @@ GET sample-index100/_search
"doc_count": 2,
"max-cpu": {
"value": 70.0
},
"max-memory": {
"value": 90.0
}
},
{
Expand All @@ -105,6 +130,9 @@ GET sample-index100/_search
"doc_count": 2,
"max-cpu": {
"value": 50.0
},
"max-memory": {
"value": 50.0
}
},
{
Expand All @@ -116,6 +144,9 @@ GET sample-index100/_search
"doc_count": 2,
"max-cpu": {
"value": 15.0
},
"max-memory": {
"value": 20.0
}
}
]
Expand Down
158 changes: 158 additions & 0 deletions _aggregations/metric/median-absolute-deviation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
---
layout: default
title: Median absolute deviation
parent: Metric aggregations
grand_parent: Aggregations
nav_order: 65
redirect_from:
- /query-dsl/aggregations/metric/median-absolute-deviation/
---

# Median absolute deviation aggregations

The `median_absolute_deviation` metric is a single-value metric aggregation that returns a median absolute deviation field. Median absolute deviation is a statistical measure of data variability. Because the median absolute deviation measures dispersion from the median, it provides a more robust measure of variability that is less affected by outliers in a dataset.

Median absolute deviation is calculated as follows:<br>
median_absolute_deviation = median(|X<sub>i</sub> - Median(X<sub>i</sub>)|)

The following example calculates the median absolute deviation of the `DistanceMiles` field in the sample dataset `opensearch_dashboards_sample_data_flights`:


```json
GET opensearch_dashboards_sample_data_flights/_search
{
"size": 0,
"aggs": {
"median_absolute_deviation_DistanceMiles": {
"median_absolute_deviation": {
"field": "DistanceMiles"
}
}
}
}
```
{% include copy-curl.html %}

#### Example response

```json
{
"took": 35,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 10000,
"relation": "gte"
},
"max_score": null,
"hits": []
},
"aggregations": {
"median_absolute_deviation_distanceMiles": {
"value": 1829.8993624441966
}
}
}
```

### Missing

By default, if a field is missing or has a null value in a document, it is ignored during computation. However, you can specify a value to be used for those missing or null fields by using the `missing` parameter, as shown in the following request:

```json
GET opensearch_dashboards_sample_data_flights/_search
{
"size": 0,
"aggs": {
"median_absolute_deviation_distanceMiles": {
"median_absolute_deviation": {
"field": "DistanceMiles",
"missing": 1000
}
}
}
}
```
{% include copy-curl.html %}

#### Example response

```json
{
"took": 7,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 10000,
"relation": "gte"
},
"max_score": null,
"hits": []
},
"aggregations": {
"median_absolute_deviation_distanceMiles": {
"value": 1829.6443646143355
}
}
}
```

### Compression

The median absolute deviation is calculated using the [t-digest](https://github.com/tdunning/t-digest/tree/main) data structure, which balances between performance and estimation accuracy through the `compression` parameter (default value: `1000`). Adjusting the `compression` value affects the trade-off between computational efficiency and precision. Lower `compression` values improve performance but may reduce estimation accuracy, while higher values enhance accuracy at the cost of increased computational overhead, as shown in the following request:

```json
GET opensearch_dashboards_sample_data_flights/_search
{
"size": 0,
"aggs": {
"median_absolute_deviation_DistanceMiles": {
"median_absolute_deviation": {
"field": "DistanceMiles",
"compression": 10
}
}
}
}
```
{% include copy-curl.html %}

#### Example response

```json
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 10000,
"relation": "gte"
},
"max_score": null,
"hits": []
},
"aggregations": {
"median_absolute_deviation_DistanceMiles": {
"value": 1836.265614211182
}
}
}
```
69 changes: 69 additions & 0 deletions _api-reference/index-apis/refresh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
layout: default
title: Refresh index
parent: Index APIs
nav_order: 61
---

# Refresh index
Introduced 1.0
{: .label .label-purple }

The Refresh Index API refreshes one or more indexes in an OpenSearch cluster. In the case of data streams, the Refresh Index API refreshes a stream's backing indexes.

OpenSearch's refresh behavior depends on whether or not `index.refresh_interval` is set:

- When set, indexes are refreshed based on the `index.refresh_interval` setting (in seconds). For more information about `index.refresh_interval` settings, see [Dynamic index-level index settings]({{site.url}}{{site.baseurl}}/install-and-configure/configuring-opensearch/index-settings/#dynamic-index-level-index-settings).
- When not set, refreshes occur every second until the shard receives no search requests for at least the amount of time specified by the `index.search.idle.after` setting (in seconds). Default is `30s`.

After a shard becomes idle, the indexes will not refresh until either the next search request or a Refresh Index API request is sent. The first search request on an idle shard will wait for the refresh operation to complete.

To use the Refresh Index API, you must have write access to the indexes you want to refresh.

## Path and HTTP methods

```json
POST /_refresh
GET /_refresh
POST /<index>/_refresh
GET /<index>/_refresh
```

## Path parameters

The following table lists the available path parameters. All path parameters are optional.

| Parameter | Data type | Description |
| :--- | :--- | :--- |
| `index` | String | A comma-separated list of index names to be refreshed. Wildcards are accepted.|

## Query parameters

The following table lists the available query parameters. All query parameters are optional.

| Parameter | Data type | Description |
| :--- | :--- | :--- |
| `ignore_unavailable` | Boolean | When `false`, the request returns an error when it targets a missing or closed index. Default is `false`.
| `allow_no_indices` | Boolean | When `false`, the Refresh Index API returns an error when a wildcard expression, index alias, or `_all` targets only closed or missing indexes, even when the request is made against open indexes. Default is `true`. |
| `expand_wildcard` | String | The type of index that the wildcard patterns can match. If the request targets data streams, this argument determines whether the wildcard expressions match any hidden data streams. Supports comma-separated values, such as `open,hidden`. Valid values are `all`, `open`, `closed`, `hidden`, and `none`.



#### Example: Refresh several data streams or indexes

The following example request refreshes two indexes named `my-index-A` and `my-index-B`:


```
POST /my-index-A,my-index-B/_refresh
```
{% include copy-curl.html %}

#### Example: Refresh all data streams and indexes in a cluster

The following request refreshes all data streams and indexes in a cluster:

```
POST /_refresh
```

Loading

0 comments on commit 237737b

Please sign in to comment.