406 / 1404 (100%) | 16/16 目录全部完成 #6

Merged
honeymoose merged 5 commits from docs_cn into main 2026-11-30 13:45:45 -05:00
2047 changed files with 323489 additions and 21130 deletions
+25 -2
View File
@@ -17,10 +17,33 @@
"Bash(grep -r \"^parent: 代理 API$\" .)",
"Bash(grep -r \"^parent: 模型组 API$\" .)",
"Bash(grep -r \"^parent: 任务 API$\" .)",
"Bash(grep -r \"^parent: 训练和预测 API$\" .)"
"Bash(grep -r \"^parent: 训练和预测 API$\" .)",
"Bash(cd /tmp/opensearch-docs-check/documentation-website && find . -name \"multi-search.md\" 2>/dev/null)",
"Read(//private/tmp/opensearch-docs-check/documentation-website/**)",
"Read(//tmp/opensearch-docs-check/documentation-website/_api-reference/search-apis/**)",
"Read(//private/tmp/opensearch-docs-check/documentation-website/_api-reference/search-apis/**)",
"Bash(comm -23 /tmp/source_files.txt /tmp/translated_files.txt | wc -l)",
"Read(//private/tmp/**)",
"Bash(comm -23 /tmp/source_files.txt /tmp/translated_files.txt | head -20)",
"Bash(comm -23 /tmp/source_files.txt /tmp/translated_files.txt)",
"Bash(find _data-prepper -name \"*.md\" -type f | sort > /tmp/source_files.txt && cat /tmp/source_files.txt)",
"Bash(python3)",
"Bash(grep -E \"^\\(gsub|html-strip|index-processors|ip2geo|join|json|kv|lowercase|ml-inference|pipeline|remove-by-pattern|remove\\\\.md|remove_by_pattern|rename|script\\)\\\\.md$\")",
"Bash(grep -E \"\\\\.md$\")",
"Bash(grep -E \"\\(connector-tool|create-anomaly-detector|data-distribution-tool|list-index-tool|log-pattern-analysis-tool|log-pattern-tool|query-planning-tool|scratchpad-tools|search-template-fill-tool|web-search-tool\\)\\\\.md$\")",
"Bash(grep -E '\\\\.md$')",
"Bash(chmod +x /tmp/check_missing_files.sh)",
"Bash(/tmp/check_missing_files.sh)",
"Bash(chmod +x /tmp/check_all_files.sh)",
"Bash(/tmp/check_all_files.sh)",
"Bash(grep \"\\\\.md$\")",
"Bash(chmod +x /tmp/verify_files.sh)",
"Bash(/tmp/verify_files.sh)",
"Bash(xargs -n1 basename)"
],
"additionalDirectories": [
"/Users/yuchenghu/Documents/WorkDir/iSharkFly/iSharkFly-Docs/OpenSearch-iSharkFly-Com/i18n/zh/clients"
"/Users/yuchenghu/Documents/WorkDir/iSharkFly/iSharkFly-Docs/OpenSearch-iSharkFly-Com/i18n/zh/clients",
"/tmp"
]
}
}
+209 -2
View File
@@ -5,7 +5,15 @@ nav_order: 5
permalink: /breaking-changes/
---
# Breaking changes
OpenSearch uses [Semantic Versioning](https://semver.org/), which means that breaking changes are only introduced between major version releases. The following sections list breaking changes introduced in OpenSearch, organized by version.
<!-- vale off -->
## 1.x
<!-- vale on -->
The following breaking changes were introduced in OpenSearch 1.x.
### Migrating to OpenSearch and limits on the number of nested JSON objects
@@ -16,6 +24,8 @@ Therefore, we recommend evaluating your data for these limits before attempting
## 2.0.0
The following breaking changes were introduced in OpenSearch 2.0.0.
### Remove mapping types parameter
The `type` parameter has been removed from all OpenSearch API endpoints. Instead, indexes can be categorized by document type. For more details, see issue [#1940](https://github.com/opensearch-project/opensearch/issues/1940).
@@ -24,21 +34,218 @@ The `type` parameter has been removed from all OpenSearch API endpoints. Instead
Non-inclusive terms are deprecated in version 2.x and will be permanently removed in OpenSearch 3.0. We are using the following replacements:
<!-- vale off -->
- "Whitelist" is now "Allow list"
- "Blacklist" is now "Deny list"
- "Master" is now "Cluster Manager"
<!-- vale on -->
<!-- vale off -->
### Add OpenSearch Notifications plugins
<!-- vale on -->
In OpenSearch 2.0, the Alerting plugin is now integrated with new plugins for Notifications. If you want to continue to use the notification action in the Alerting plugin, install the new backend plugins `notifications-core` and `notifications`. If you want to manage notifications in OpenSearch Dashboards, use the new `notificationsDashboards` plugin. For more information, see [Notifications]({{site.url}}{{site.baseurl}}/observing-your-data/notifications/index/) on the OpenSearch documentation page.
### Drop support for JDK 8
A Lucene upgrade forced OpenSearch to drop support for JDK 8. As a consequence, the [Java high-level REST client]({{site.url}}{{site.baseurl}}/clients/java-rest-high-level/) no longer supports JDK 8. Restoring JDK 8 support is currently an `opensearch-java` proposal [#156](https://github.com/opensearch-project/opensearch-java/issues/156) and will require removing OpenSearch core as a dependency from the Java client (issue [#262](https://github.com/opensearch-project/opensearch-java/issues/262)).
A Lucene upgrade forced OpenSearch to drop support for JDK 8. As a consequence, the Java high-level REST client no longer supports JDK 8. Restoring JDK 8 support is currently an `opensearch-java` proposal [#156](https://github.com/opensearch-project/opensearch-java/issues/156) and will require removing OpenSearch core as a dependency from the Java client (issue [#262](https://github.com/opensearch-project/opensearch-java/issues/262)).
## 2.5.0
The following breaking change was introduced in OpenSearch 2.5.0.
### Wildcard query behavior for text fields
OpenSearch 2.5 contains a bug fix to correct the behavior of the `case_insensitive` parameter for the `wildcard` query on text fields. As a result, a wildcard query on text fields that ignored case sensitivity and erroneously returned results prior to the bug fix will not return the same results. For more information, see issue [#8711](https://github.com/opensearch-project/OpenSearch/issues/8711).
OpenSearch 2.5 contains a bug fix that corrects the behavior of the `case_insensitive` parameter for the `wildcard` query on text fields. As a result, a wildcard query on text fields that ignored case sensitivity and erroneously returned results prior to the bug fix will not return the same results. For more information, see issue [#8711](https://github.com/opensearch-project/OpenSearch/issues/8711).
## 2.18.0
The following breaking change was introduced in OpenSearch 2.18.0.
### Default k-NN engine change
The default k-NN engine changed from NMSLIB to Faiss. If you use `space_type: "cosinesimil"` without explicitly specifying an engine, your vectors are now automatically normalized to unit length during indexing. This happens because Faiss does not natively support cosine similarity and instead uses inner product on normalized vectors. As a result, stored vector values will differ from input values, which may affect code that retrieves and compares vectors. If your vectors are already normalized, consider setting `space_type` to `innerproduct` instead of `cosinesimil` to obtain mathematically equivalent results with explicit control over normalization. For more information, see pull request [#2221](https://github.com/opensearch-project/k-NN/pull/2221).
## 2.19.0
The following breaking change was introduced in OpenSearch 2.19.0.
### Nested value support in the text embedding processor
The `text_embedding` processor no longer replaces nested values like `_ingest._value` when evaluating fields like `title_tmp:_ingest._value.title_embedding`. Instead, you must directly specify the nested key as `books.title:title_embedding` to achieve the desired output. For more information, see issue [#1243](https://github.com/opensearch-project/neural-search/issues/1243).
## 3.0.0
The following breaking changes were introduced in OpenSearch 3.0.0.
### JDK requirement
The minimum supported JDK version is JDK 21.
### Version compatibility setting
The `compatibility.override_main_response_version` setting has been removed. This functionality was deprecated in OpenSearch 1.x and is no longer supported.
For more information, see issue [#18228](https://github.com/opensearch-project/OpenSearch/issues/18228).
For alternative approaches, see [Agents and ingestion tools]({{site.url}}{{site.baseurl}}/tools/#agents-and-ingestion-tools).
### Index version
Indexes created in versions earlier than `2.x.x` (including system indexes) are not supported. These indexes must be reindexed **before upgrading**. For information about reindexing, see [Reindex data]({{site.url}}{{site.baseurl}}/im-plugin/reindex-data/).
For more information, see issue [#18717](https://github.com/opensearch-project/OpenSearch/issues/18717).
### System index access
Access to system indexes through the REST API is no longer provided. This functionality has been deprecated since OpenSearch 1.x. For more information, see issue [#7936](https://github.com/opensearch-project/OpenSearch/issues/7936).
### Document ID length limits
The document ID length limit of 512 bytes is now consistently enforced across all APIs, including the Bulk API. Previously, the Bulk API allowed document IDs longer than 512 bytes. For more information, see issue [#6595](https://github.com/opensearch-project/OpenSearch/issues/6595).
### Node role configuration
The configuration of empty node roles using environment variables has been fixed. Setting `node.roles=` using environment variables now properly configures a coordinating-only node, consistent with the `opensearch.yml` configuration. For more information, see issue [#3412](https://github.com/opensearch-project/OpenSearch/issues/3412).
### JSON processing limits
New default limits have been introduced for JSON processing (using the Jackson library) throughout OpenSearch:
- The maximum nesting depth of JSON objects and arrays is limited to 1,000 levels.
- The maximum length of JSON property names is limited to 50,000 units (bytes or chars, depending on the input source).
These limits help prevent potential memory issues and denial-of-service attacks. For more information, see issue [#11278](https://github.com/opensearch-project/OpenSearch/issues/11278).
### Nested query depth
A new `index.query.max_nested_depth` setting has been introduced with a default value of `20` and a minimum value of `1`, limiting the maximum number of nesting levels for `nested` queries. For more information, see issue [#3268](https://github.com/opensearch-project/OpenSearch/issues/3268).
### Thread pool settings
The following deprecated thread pool settings have been removed:
- `thread_pool.test.max_queue_size`
- `thread_pool.test.min_queue_size`
For more information, see issue [#2595](https://github.com/opensearch-project/OpenSearch/issues/2595).
### Index store settings
The `index.store.hybrid.mmap.extensions` setting has been removed as part of improvements to `hybridfs` file handling. For more information, see pull request [#9392](https://github.com/opensearch-project/OpenSearch/pull/9392).
### Transport NIO plugin
The `transport-nio` plugin has been removed. Netty remains the standard network framework for both node-to-node and client-to-server communication. For more information, see issue [#16887](https://github.com/opensearch-project/OpenSearch/issues/16887).
### Nodes API response format
The format of indexing buffer values in the Nodes API response has changed:
- `total_indexing_buffer_in_bytes` now displays raw bytes (for example, `53687091`).
- `total_indexing_buffer` now displays human-readable format (for example, `51.1mb`).
For more information, see pull request [#17070](https://github.com/opensearch-project/OpenSearch/pull/17070).
### PathHierarchy tokenizer
The camel case `PathHierarchy` tokenizer name has been deprecated in favor of the snake case `path_hierarchy`. For more information, see pull request [#10894](https://github.com/opensearch-project/OpenSearch/pull/10894).
### Security plugin
The Blake2b hash implementation now uses the salt parameter correctly, which will result in different (though correct) hash values compared to previous versions. For more information, see pull request [#5089](https://github.com/opensearch-project/security/pull/5089).
### k-NN plugin
The following deprecated settings have been removed from the k-NN plugin:
- `knn.plugin.enabled` setting
- `index.knn.algo_param.ef_construction` index setting
- `index.knn.algo_param.m` index setting
- `index.knn.space_type` index setting
The NMSLIB engine is now deprecated. We recommend using the Faiss or Lucene engines instead.
For more information, see pull request [#2564](https://github.com/opensearch-project/k-NN/pull/2564).
### Performance Analyzer plugin
The `performance-analyzer-rca` agent has been removed. The agent served the Performance Analyzer API on port 9600, so the metrics, batch metrics, and root cause analysis (RCA) APIs and the PerfTop dashboards are no longer available. The Performance Analyzer plugin remains installed by default and can publish its metrics using the [metrics framework]({{site.url}}{{site.baseurl}}/tuning-your-cluster/monitoring/telemetry/metrics/), which exports them using OpenTelemetry. For more information, see [Performance Analyzer]({{site.url}}{{site.baseurl}}/tuning-your-cluster/monitoring/telemetry/performance-analyzer/) and issue [#591](https://github.com/opensearch-project/performance-analyzer-rca/issues/591).
### SQL plugin
- The OpenSearch query domain-specific language (DSL) response format has been removed.
- `DELETE` statement support has been removed.
- The `plugins.sql.delete.enabled` setting has been removed.
- The legacy Spark Connector module has been deprecated. For information about connecting to Spark, see [`async-query-core`](https://github.com/opensearch-project/sql/blob/main/async-query-core/README.md).
- Deprecated OpenDistro endpoints and legacy settings with the `opendistro` prefix have been removed.
- The `plugins.sql.pagination.api` has been removed and the Scroll API has been deprecated. Pagination now defaults to Point in Time.
For more information, see issue [#3248](https://github.com/opensearch-project/sql/issues/3248).
### OpenSearch Dashboards
- Discover experience:
- The `discover:newExperience` setting has been removed.
- The DataGrid table feature has been removed.
For more information, see pull request [#9511](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9511).
- Visualizations: The `dashboards-visualizations` plugin (including Gantt chart visualization) has been removed. We recommend transitioning to:
- Vega visualization for flexible visualization needs.
- Trace analytics for trace-related use cases.
For more information, see issue [#430](https://github.com/opensearch-project/dashboards-visualizations/issues/430).
### Dashboards Observability plugin
The legacy notebooks feature has been removed from `dashboards-observability`. Key changes include the following:
- Legacy notebooks (previously stored in the `.opensearch-observability` index) are no longer supported.
- Only notebooks stored in the `.kibana` index (introduced in version 2.17) are supported.
- You must migrate your notebooks to the new storage system before upgrading to version 3.0.
For more information, see issue [#2350](https://github.com/opensearch-project/dashboards-observability/issues/2350).
### Searchable snapshots node role
Nodes that use searchable snapshots must have the `warm` node role. Key changes include the following:
- The `search` role no longer supports searchable snapshots.
- Nodes that handle searchable snapshot shards must be assigned the warm role.
- You must update node role configurations before upgrading to version 3.0 if your cluster uses searchable snapshots.
For more information, see pull request [#17573](https://github.com/opensearch-project/OpenSearch/pull/17573).
### Query groups
Query groups have been renamed to **workload groups**. Key changes include the following:
- The `wlm/query_group` endpoint is now the `wlm/workload_group` endpoint.
- The API responds with a `workloadGroupID` instead of a `queryGroupID`.
- All workload management cluster settings are now prepended with `wlm.workload_group`.
For more information, see pull request [#9813](https://github.com/opensearch-project/OpenSearch/pull/17901).
### ML Commons plugin
- The `CatIndexTool` is removed in favor of the `ListIndexTool`.
- The Asynchronous Batch Ingestion API (`POST /_plugins/_ml/_batch_ingestion`) is removed. For similar functionality, use [OpenSearch Data Prepper]({{site.url}}{{site.baseurl}}/data-prepper/). For more information, see pull request [#3688](https://github.com/opensearch-project/ml-commons/pull/3688).
### Romanian analysis
The `romanian` analyzer now supports Romanian in its modern Unicode form and normalizes cedilla characters to their comma-based equivalents. Because both forms are still in use, we recommend reindexing existing Romanian documents to ensure consistent analysis and search behavior.
## 3.10.0
The following breaking changes were introduced in OpenSearch 3.10.0.
### ML Commons plugin
The validation of private and internal IP addresses has been updated as follows:
- Link-local addresses (`169.254.0.0/16` and `fe80::/10`) and cloud instance metadata addresses (`fd00:ec2::/32`, `fd20:ce::254`, and `100.100.100.200`) are always refused, regardless of the `plugins.ml_commons.connector.private_ip_enabled` setting. Requests to these addresses fail with the error `Remote inference host name has restricted ip address: <host>`. Any connector using such an endpoint requires a different one.
- IPv6 unique-local addresses (`fc00::/7`) and the local-use NAT64 range (`64:ff9b:1::/48`) are private addresses. Connectors that use them require `plugins.ml_commons.connector.private_ip_enabled` to be `true` and, if `plugins.ml_commons.trusted_connector_private_endpoints_regex` is not empty, a matching expression in that list.
- The `plugins.ml_commons.connector.private_ip_enabled`, `plugins.ml_commons.trusted_connector_private_endpoints_regex`, and `plugins.ml_commons.connector.restricted_ip_patterns` settings also apply to streaming prediction requests that use the `openai/v1/chat/completions` or `gemini/v1beta/generatecontent` interface. These requests connect directly, without a JVM-wide HTTP proxy, and do not follow redirects.
For more information, see [Connector endpoint settings]({{site.url}}{{site.baseurl}}/ml-commons-plugin/cluster-settings/#connector-endpoint-settings) and pull requests [#5204](https://github.com/opensearch-project/ml-commons/pull/5204) and [#5206](https://github.com/opensearch-project/ml-commons/pull/5206).
+90 -52
View File
@@ -5,81 +5,119 @@ nav_order: 1
has_children: false
has_toc: false
nav_exclude: true
description: "Documentation for OpenSearch and OpenSearch Dashboards, the open-source suite for full-text search, application monitoring, log analytics, and vector search."
permalink: /about/
redirect_from:
- /docs/opensearch/
- /opensearch/
- /opensearch/index/
why_use:
- heading: "Vector database"
description: "Use OpenSearch as a vector database to combine the power of traditional search, analytics, and vector search"
link: "/vector-search/"
image: "/images/icons/vector-search-square.png"
image_alt: "Vector search icon"
- heading: "Fast, scalable full-text search"
description: "Help users find the right information in your application, website, or data lake catalog"
link: "/search-plugins/"
image: "/images/icons/Icon_Lexical_Search-150x150.avif"
image_alt: "Lexical search icon"
- heading: "Application and infrastructure monitoring"
description: "Use observability logs, metrics, and traces to monitor your applications in real time"
link: "/observing-your-data/"
image: "/images/icons/Icon_Observability-150x150.avif"
image_alt: "Observability monitoring icon"
- heading: "Data analytics"
description: "Analyze and visualize your data in OpenSearch Dashboards"
link: "/dashboards/"
image: "/images/icons/OpenSearch-Dashboards-Square.png"
image_alt: "OpenSearch Dashboards icon"
features:
- heading: "Install and configure"
description: "Set up OpenSearch and OpenSearch Dashboards on your preferred platform"
link: "/install-and-configure/"
- heading: "Security"
description: "Configure authentication, access control, and encryption for your cluster"
link: "/security/"
- heading: "Index management"
description: "Create indexes, manage templates, and automate index lifecycle"
link: "/im-plugin/"
- heading: "Mappings"
description: "Define field types to control how data is indexed"
link: "/mappings/"
- heading: "API reference"
description: "Full reference for all OpenSearch REST and gRPC APIs"
link: "/api-reference/"
- heading: "Query DSL"
description: "Search your data using the OpenSearch query language"
link: "/query-dsl/"
- heading: "Vector search"
description: "Use vector and AI-powered search to build modern search applications"
link: "/vector-search/"
- heading: "AI and machine learning"
description: "Deploy models, connect to AI platforms, and build AI agents and assistants"
link: "/ml-commons-plugin/"
getting_started:
- heading: "Get started with OpenSearch"
description: "Learn about OpenSearch and start ingesting and searching data"
link: "/getting-started/"
image: "/images/icons/OpenSearch-Core.png"
image_alt: "OpenSearch Core icon"
- heading: "Get started with OpenSearch Dashboards"
description: "Learn about OpenSearch Dashboards applications and tools used to visualize data"
link: "/dashboards/getting-started/"
image: "/images/icons/OpenSearch-Dashboards.png"
image_alt: "OpenSearch Dashboards icon"
- heading: "Get started with vector search"
description: "Learn about vector search options and build your first vector search application"
link: "/vector-search/getting-started/"
image: "/images/icons/Vector-search-icon.avif"
image_alt: "Vector search icon"
- heading: "Get started with OpenSearch security"
description: "Learn about security in OpenSearch"
link: "/security/getting-started/"
image: "/images/icons/OpenSearch-Security.png"
image_alt: "OpenSearch Security icon"
- heading: "Get started with observability"
description: "Send logs to OpenSearch and visualize them in OpenSearch Dashboards"
link: "/observing-your-data/log-ingestion/"
image: "/images/icons/OpenSearch-Observability.png"
image_alt: "OpenSearch Observability icon"
- heading: "Explore tutorials"
description: "Follow step-by-step tutorials for search, vector search, and generative AI applications"
link: "/tutorials/"
image: "/images/icons/Workflow-Icon.avif"
image_alt: "Workflow icon"
---
{%- comment -%}The `/docs/opensearch/` redirect is specifically to support the UI links in OpenSearch Dashboards 1.0.0.{%- endcomment -%}
# OpenSearch and OpenSearch Dashboards
# ![OpenSearch icon]({{site.url}}{{site.baseurl}}/images/icons/OpenSearch-Core.png){: .heading-icon} OpenSearch and OpenSearch Dashboards
**Version {{site.opensearch_major_minor_version}}**
{: .label .label-blue }
This section contains documentation for OpenSearch and OpenSearch Dashboards.
OpenSearch is a scalable, open-source search and analytics suite for full-text search, application monitoring, log analytics, and vector search. OpenSearch Dashboards provides the visualization and management interface.
## Getting started
- [Intro to OpenSearch]({{site.url}}{{site.baseurl}}/intro/)
- [Quickstart]({{site.url}}{{site.baseurl}}/quickstart/)
- [Install OpenSearch]({{site.url}}{{site.baseurl}}/install-and-configure/install-opensearch/index/)
- [Install OpenSearch Dashboards]({{site.url}}{{site.baseurl}}/install-and-configure/install-dashboards/index/)
- [See the FAQ](https://opensearch.org/faq)
{% include cards.html cards=page.getting_started %}
## Why use OpenSearch?
## Use cases
With OpenSearch, you can perform the following use cases:
{% include cards.html cards=page.why_use documentation_link=true %}
<table style="table-layout: auto ; width: 100%;">
<tbody>
<tr style="text-align: center; vertical-align:center;">
<td><img src="{{site.url}}{{site.baseurl}}/images/1_search.png" class="no-border" alt="Fast, scalable full-text search" height="100"/></td>
<td><img src="{{site.url}}{{site.baseurl}}/images/2_monitoring.png" class="no-border" alt="Application and infrastructure monitoring" height="100"/></td>
<td><img src="{{site.url}}{{site.baseurl}}/images/3_security.png" class="no-border" alt="Security and event information management" height="100"/></td>
<td><img src="{{site.url}}{{site.baseurl}}/images/4_tracking.png" class="no-border" alt="Operational health tracking" height="100"/></td>
</tr>
<tr style="text-align: left; vertical-align:top; font-weight: bold; color: rgb(0,59,92)">
<td>Fast, Scalable Full-text Search</td>
<td>Application and Infrastructure Monitoring</td>
<td>Security and Event Information Management</td>
<td>Operational Health Tracking</td>
</tr>
<tr style="text-align: left; vertical-align:top;">
<td>Help users find the right information within your application, website, or data lake catalog. </td>
<td>Easily store and analyze log data, and set automated alerts for underperformance.</td>
<td>Centralize logs to enable real-time security monitoring and forensic analysis.</td>
<td>Use observability logs, metrics, and traces to monitor your applications and business in real time.</td>
</tr>
</tbody>
</table>
## Popular documentation
**Additional features and plugins:**
{% include cards.html cards=page.features %}
OpenSearch has several features and plugins to help index, secure, monitor, and analyze your data. Most OpenSearch plugins have corresponding OpenSearch Dashboards plugins that provide a convenient, unified user interface.
- [Anomaly detection]({{site.url}}{{site.baseurl}}/monitoring-plugins/ad/) - Identify atypical data and receive automatic notifications
- [KNN]({{site.url}}{{site.baseurl}}/search-plugins/knn/) - Find “nearest neighbors” in your vector data
- [Performance Analyzer]({{site.url}}{{site.baseurl}}/monitoring-plugins/pa/) - Monitor and optimize your cluster
- [SQL]({{site.url}}{{site.baseurl}}/search-plugins/sql/index/) - Use SQL or a piped processing language to query your data
- [Index State Management]({{site.url}}{{site.baseurl}}/im-plugin/) - Automate index operations
- [ML Commons plugin]({{site.url}}{{site.baseurl}}/ml-commons-plugin/index/) - Train and execute machine-learning models
- [Asynchronous search]({{site.url}}{{site.baseurl}}/search-plugins/async/) - Run search requests in the background
- [Cross-cluster replication]({{site.url}}{{site.baseurl}}/replication-plugin/index/) - Replicate your data across multiple OpenSearch clusters
## The secure path forward
OpenSearch includes a demo configuration so that you can get up and running quickly, but before using OpenSearch in a production environment, you must [configure the Security plugin manually]({{site.url}}{{site.baseurl}}/security/configuration/index/) with your own certificates, authentication method, users, and passwords.
## Looking for the Javadoc?
See [opensearch.org/javadocs/](https://opensearch.org/javadocs/).
## Get involved
[OpenSearch](https://opensearch.org) is supported by Amazon Web Services. All components are available under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.html) on [GitHub](https://github.com/opensearch-project/).
The project welcomes GitHub issues, bug fixes, features, plugins, documentation---anything at all. To get involved, see [Contributing](https://opensearch.org/source.html) on the OpenSearch website.
[OpenSearch](https://opensearch.org) is supported by the OpenSearch Software Foundation. All components are available under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.html) on [GitHub](https://github.com/opensearch-project/).
The project welcomes GitHub issues, bug fixes, features, plugins, documentation---anything at all. To get involved, see [Contributing](https://github.com/opensearch-project/.github/blob/main/CONTRIBUTING.md).
---
<small>OpenSearch includes certain Apache-licensed Elasticsearch code from Elasticsearch B.V. and other source code. Elasticsearch B.V. is not the source of that other source code. ELASTICSEARCH is a registered trademark of Elasticsearch B.V.</small>
<!-- vale off -->
<small>OpenSearch includes certain Apache-licensed Elasticsearch code from Elasticsearch B.V. and other source code. Elasticsearch B.V. is not the source of that other source code. ELASTICSEARCH is a registered trademark of Elasticsearch B.V.</small>
<!-- vale on -->
+80 -44
View File
@@ -2,52 +2,88 @@
layout: default
title: Version history
nav_order: 4
description: "A history of OpenSearch releases, with release highlights and release dates for each version, linked to the full release notes."
permalink: /version-history/
---
# Version history
OpenSearch version | Release highlights | Release date
:--- | :--- | :---
[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
[2.11.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.11.0.md) | Adds multimodal and sparse neural search capability and the ability to take shallow snapshots that refer to data stored in remote-backed storage. Makes the search comparison tool generally available. Includes a simplified workflow to create threat detectors in Security Analytics and improved security in OpenSearch Dashboards. Experimental features include a new framework and toolset for distributed tracing and updates to conversational search. For a full list of release highlights, see the Release Notes. | 16 October 2023
[2.10.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.10.0.md) | Makes remote-backed storage generally available. Adds hybrid search capability, custom log types for Security Analytics, IP2Geo ingest processor, and delimited term frequency token filter. Includes a new look and feel for OpenSearch Dashboards and updates the Discover tool. Adds Microsoft Teams webhook support for notifications. Experimental features include concurrent segment search and conversational search. For a full list of release highlights, see the Release Notes. | 25 September 2023
[2.9.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.9.0.md) | Makes search pipelines and the Neural Search plugin generally available. Adds ML model access control and integration with external ML tools. Implements k-NN byte vectors and efficient filtering with the Faiss engine. Integrates alerting and anomaly detection with OpenSearch Dashboards and adds composite monitors. Adds two new index codec algorithm options. Includes a new ingestion schema for Security Analytics, geoshape aggregations, and extensions---a new mechanism for extending OpenSearch functionality. For a full list of release highlights, see the Release Notes. | 24 July 2023
[2.8.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.8.0.md) | Adds cross-cluster query with PPL, search pipelines, an option to turn on segment replication as the default replication type, improved searchable snapshot performance, and Amazon OpenSearch Serverless support with SigV4 authentication for multiple data sources. Includes the UI for the flush, refresh, and clear cache operations in OpenSearch Dashboards. For a full list of release highlights, see the Release Notes. | 06 June 2023
[2.7.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.7.0.md) | Includes searchable snapshots and segment replication, which are now generally available. Adds multiple data sources, observability features, dynamic tenant management, component templates, and shape-based map filters in OpenSearch Dashboards. Includes the flat object field type, hot shard identification, and a new automatic reloading mechanism for ML models. For a full list of release highlights, see the Release Notes. | 02 May 2023
[2.6.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.6.0.md) | Includes simple schema for observability, index management UI enhancements, Security Analytics enhancements, search backpressure at the coordinator node level, and the ability to add maps to dashboards. Experimental features include a new ML model health dashboard, new text embedding models in ML, and SigV4 authentication in Dashboards. For a full list of release highlights, see the Release Notes. | 28 February 2023
[2.5.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.5.0.md) | Includes index management UI enhancements, multi-layer maps, Jaeger support for observability, Debian distributions, returning cluster health by awareness attribute, cluster manager task throttling, weighted zonal search request routing policy, and query string support in index rollups. Experimental features include request-level durability in remote-backed storage and GPU acceleration for ML nodes. For a full list of release highlights, see the Release Notes. | 24 January 2023
[2.4.1](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.4.1.md) | Includes maintenance changes and bug fixes for gradle check and indexing pressure tests. Adds support for skipping changelog. | 13 December 2022
[2.4.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.4.0.md) | Includes Windows support, Point-in-time search, custom k-NN filtering, xy_point and xy_shape field types for Cartesian coordinates, GeoHex grid aggregation, and resilience enhancements, including search backpressure. In OpenSearch Dashboards, this release adds snapshot restore functionality, multiple authentication, and aggregate view of saved objects. This release includes the following experimental features: searchable snapshots, Compare Search Results, multiple data sources in OpenSearch Dashboards, a new Model Serving Framework in ML Commons, a new Neural Search plugin that supports semantic search, and a new Security Analytics plugin to analyze security logs. For a full list of release highlights, see the Release Notes. | 15 November 2022
[2.3.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.3.0.md) | This release includes the following experimental features: segment replication, remote-backed storage, and drag and drop for OpenSearch Dashboards. Experimental features allow you to test new functionality in OpenSearch. Because these features are still being developed, your testing and feedback can help shape the development of the feature before it's official released. We do not recommend use of experimental features in production. Additionally, this release adds maketime and makedate datetime functions for the SQL plugin. Creates a new [OpenSearch Playground](https://playground.opensearch.org) demo site for OpenSearch Dashboards. For a full list of release highlights, see the Release Notes. | 14 September 2022
[2.2.1](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.2.1.md) | Includes gradle updates and bug fixes for gradle check. | 01 September 2022
[2.2.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.2.0.md) | Includes support for Logistic Regression and RCF Summarize machine learning algorithms in ML Commons, Lucene or C-based Nmslib and Faiss libraries for approximate k-NN search, search by relevance using SQL and PPL queries, custom region maps for visualizations, and rollup enhancements. For a full list of release highlights, see the Release Notes. | 11 August 2022
[2.1.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.1.0.md) | Includes support for dedicated ML node in the ML Commons plugin, relevance search and other features in SQL, multi-terms aggregation, and Snapshot Management. For a full list of release highlights, see the Release Notes. | 07 July 2022
[2.0.1](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.0.1.md) | Includes bug fixes and maintenance updates for Alerting and Anomaly Detection. | 16 June 2022
[2.0.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.0.0.md) | Includes document-level monitors for alerting, OpenSearch Notifications plugins, and Geo Map Tiles in OpenSearch Dashboards. Also adds support for Lucene 9 and bug fixes for all OpenSearch plugins. For a full list of release highlights, see the Release Notes. | 26 May 2022
[2.0.0-rc1](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.0.0-rc1.md) | The Release Candidate for 2.0.0. This version allows you to preview the upcoming 2.0.0 release before the GA release. The preview release adds document-level alerting, support for Lucene 9, and the ability to use term lookup queries in document level security. | 03 May 2022
[1.3.15](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.15.md) | Includes bug fixes and maintenance updates for cross-cluster replication, SQL, OpenSearch Dashboards reporting, and alerting. | 05 March 2024
[1.3.14](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.14.md) | Includes bug fixes and maintenance updates for OpenSearch security and OpenSearch Dashboards security. | 12 December 2023
[1.3.13](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.13.md) | Includes bug fixes for Anomaly Detection, adds maintenance updates and infrastructure enhancements. | 21 September 2023
[1.3.12](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.12.md) | Adds maintenance updates for OpenSearch security and OpenSearch Dashboards observability. Includes bug fixes for observability, OpenSearch Dashboards visualizations, and OpenSearch security. | 10 August 2023
[1.3.11](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.11.md) | Adds maintenance updates for OpenSearch security, OpenSearch Dashboards security, and ML Commons. | 29 June 2023
[1.3.10](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.10.md) | Adds infrastructure enhancements and maintenance updates for anomaly detection, observability, and security. Includes bug fixes for index management and OpenSearch security. | 18 May 2023
[1.3.9](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.9.md) | Adds Debian support. Includes upgrades, enhancements, and maintenance updates for OpenSearch core, k-NN, and OpenSearch security. | 16 March 2023
[1.3.8](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.8.md) | Adds OpenSearch security enhancements. Updates tool scripts to run on Windows. Includes maintenance updates and bug fixes for Anomaly Detection and OpenSearch security. | 02 February 2023
[1.3.7](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.7.md) | Adds Windows support. Includes maintenance updates and bug fixes for error handling. | 13 December 2022
[1.3.6](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.6.md) | Includes maintenance updates and bug fixes for tenancy in the OpenSearch Security Dashboards plugin. | 06 October 2022
[1.3.5](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.5.md) | Includes maintenance updates and bug fixes for gradle check and OpenSearch security. | 01 September 2022
[1.3.4](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.4.md) | Includes maintenance updates and bug fixes for OpenSearch and OpenSearch Dashboards. | 14 July 2022
[1.3.3](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.3.md) | Adds enhancements to Anomaly Detection and ML Commons. Bug fixes for Anomaly Detection, Observability, and k-NN. | 09 June 2022
[1.3.2](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.2.md) | Bug fixes for Anomaly Detection and the Security Dashboards Plugin, adds the option to install OpenSearch using RPM, as well as enhancements to the ML Commons execute task, and the removal of the job-scheduler zip in Anomaly Detection. | 05 May 2022
[1.3.1](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.1.md) | Bug fixes when using document-level security, and adjusted ML Commons to use the latest RCF jar and protostuff to RCF model serialization. | 30 March 2022
[1.3.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.0.md) | Adds Model Type Validation to Validate Detector API, continuous transforms, custom actions, applied policy parameter to Explain API, default action retries, and new rollover and transition conditions to Index Management, new ML Commons plugin, parse command to SQL, Application Analytics, Live Tail, Correlation, and Events Flyout to Observability, and auto backport and support for OPENSEARCH_JAVA_HOME to Performance Analyzer. Bug fixes. | 17 March 2022
[1.2.4](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.2.4.md) | Updates Performance Analyzer, SQL, and Security plugins to Log4j 2.17.1, Alerting and Job Scheduler to cron-utils 9.1.6, and gson in Anomaly Detection and SQL. | 18 January 2022
[1.2.3](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.2.3.md) | Updates the version of Log4j used in OpenSearch to Log4j 2.17.0 as recommended by the advisory in [CVE-2021-45105](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-45105). | 22 December 2021
[1.2.0](https://github.com/opensearch-project/OpenSearch/blob/main/release-notes/opensearch.release-notes-1.2.0.md) | Adds observability, new validation API for Anomaly Detection, shard-level indexing back-pressure, new "match" query type for SQL and PPL, support for Faiss libraries in k-NN, and custom Dashboards branding. | 23 November 2021
[1.1.0](https://github.com/opensearch-project/opensearch-build/tree/main/release-notes/opensearch-release-notes-1.1.0.md) | Adds cross-cluster replication, security for Index Management, bucket-level alerting, a CLI to help with upgrading from Elasticsearch OSS to OpenSearch, and enhancements to high cardinality data in the anomaly detection plugin. | 05 October 2021
[1.0.1](https://github.com/opensearch-project/opensearch-build/tree/main/release-notes/opensearch-release-notes-1.0.1.md) | Bug fixes. | 01 September 2021
[1.0.0](https://github.com/opensearch-project/opensearch-build/tree/main/release-notes/opensearch-release-notes-1.0.0.md) | General availability release. Adds compatibility setting for clients that require a version check before connecting. | 12 July 2021
[1.0.0-rc1](https://github.com/opensearch-project/opensearch-build/tree/main/release-notes/opensearch-release-notes-1.0.0-rc1.md) | First release candidate. | 07 June 2021
[1.0.0-beta1](https://github.com/opensearch-project/opensearch-build/tree/main/release-notes/opensearch-release-notes-1.0.0-beta1.md) | Initial beta release. Refactors plugins to work with OpenSearch. | 13 May 2021
OpenSearch version | Release highlights | Release date
:--- | :--- | :---
[3.10.1](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.10.1.md) | Updates the bundled JDK to 25.0.5.1+2 to address CVE-2026-114938, a remote code execution vulnerability in OpenJDK 17 and later. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.10.1.md). | 24 November 2026
[3.10.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.10.0.md) | Introduces fusion mode for the `hybrid` query, enabling score normalization and combination directly in the query body without a search pipeline and making hybrid queries nestable inside `bool` and `dis_max` queries. Extends pull-based ingestion to data at rest in object storage (Amazon S3, Google Cloud Storage, and Azure Blob Storage) and adds post-restore hooks so Alerting and ISM resume from snapshot state instead of restarting. Introduces experimental agentic search templates, updated Google Cloud connector blueprints for Gemini, and request throttling for workload groups. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.10.0.md). | 16 November 2026
[3.9.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.9.0.md) | Adds the `half_float` vector data type, the `bf16` scalar quantization encoder, 2-bit and 4-bit scalar quantization, and dynamic mapping for `knn_vector` fields. Introduces server-side batch inference for machine learning models and adaptive per-action concurrency limits. Brings anomaly detection and forecasting into the unified alerts view and makes the Resource Sharing and Access Control framework generally available. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.9.0.md). | 29 September 2026
[3.8.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.8.0.md) | Delivers up to 4.2x faster vector ingestion with Base64-encoded vectors and up to 2.1x higher radial search throughput with improved recall. Extends Model Context Protocol (MCP) support to flow and conversational flow agents, adds a list tools API and connector-level tool description overrides, and introduces experimental retention policies for agentic memory. Adds gRPC streaming for ML predictions and agent execution, expands LLM-as-a-Judge in Search Relevance Workbench to additional models, and adds a Grok debugger in OpenSearch Dashboards. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.8.0.md). | 04 August 2026
[3.7.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.7.0.md) | Adds native Prometheus integration with PromQL support for unified observability across logs, traces, and metrics. Delivers up to 5.5x faster vector retrieval using doc values and expands hybrid search optimization with z_score normalization and Reciprocal Rank Fusion. Introduces API keys with scoped permissions, ISM policy simulation for safe preview of index lifecycle changes, and a Query Profiler tool in OpenSearch Dashboards. Makes unified agent registration and conversational_v2 agent type generally available for production AI workloads. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.7.0.md). | 09 June 2026
[3.6.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.6.0.md) | Introduces Agent-v2 with token usage tracking, observability traces, and relevance tuning capabilities. Adds Application Performance Monitoring (APM) to observability with service dependencies and performance metrics. Makes pull-based ingestion generally available with warmup settings and adaptive shard selection. Expands vector search with 1-bit scalar quantization and enhances Query Insights with detailed grouping and failure tracking. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.6.0.md). | 07 April 2026
[3.5.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.5.0.md) | Introduces agentic conversation memory and context management for intelligent AI applications. Delivers 58% vector search throughput improvements with bulk SIMD implementation for FP16 operations. Expands Prometheus support with native Discover experience and enhanced PPL functions for observability workloads. Makes Search Relevance Workbench generally available with LLM-powered evaluation capabilities. Includes query insights enhancements with automatic user tracking and experimental HTTP/3 transport support. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.5.0.md). | 10 February 2026
[3.4.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.4.0.md) | Introduces PPL alerting capabilities with monitor execution and stats management. Adds Anomaly Detection Daily Insights Page and Flow Framework enhancements including agent summary and MCP server support. Includes k-NN memory-optimized search warmup, native FP16 vector scoring, and enhanced resource sharing frameworks. Features infrastructure upgrades including JDK 25 and improved access control. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.4.0.md). | 16 December 2025
[3.3.2](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.3.2.md) | Includes maintenance changes and bug fixes for the OpenSearch core engine and ML Commons, Neural Search, Skills, k-NN and Security plugins. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.3.2.md). | 30 October 2025
[3.3.1](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.3.1.md) | Fixes backward compatibility handling of date fields while maintaining performance optimizations. The `skip_list` parameter is now automatically set to `true` for new `@timestamp` fields created since 3.3.0, while preserving `skip_list=false` for existing indexes with `@timestamp` or index sort date fields. This approach ensures date histogram aggregation performance benefits for new indexes while maintaining compatibility with existing workloads. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.3.1.md). | 22 October 2025
[3.3.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.3.0.md) | Introduces redesigned Discover interface with log analytics and distributed tracing capabilities, and Apache Calcite as default PPL query engine with expanded functions. Makes agentic search and agentic memory APIs generally available for AI applications. Implements Seismic algorithm for neural sparse search performance improvements and processor chains for data transformation pipelines. Expands gRPC support for additional query types and adds experimental streaming with Apache Arrow Flight. Includes workload management enhancements with rule-based auto-tagging and query monitoring capabilities. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.3.0.md). | 14 October 2025
[3.2.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.2.0.md) | Updates Search Relevance Workbench. Makes gRPC APIs generally available. Introduces derived source, updates workload management, semantic field, and star tree functionality. Adds experimental Agentic Memory APIs and Job Scheduler APIs. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.2.0.md). | 19 August 2025
[3.1.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.1.0.md) | Makes GPU acceleration for vector index builds generally available. Introduces memory-optimized search for Faiss indexes using Lucene HNSW, semantic field type for streamlined semantic search, and Search Relevance Workbench for search quality optimization. Makes star-tree indexes generally available with support for comprehensive query types. Enhances observability with ML Commons metrics integration, custom index support for OpenTelemetry data, and new PPL commands for JSON manipulation. Improves agent management with Update Agent API and persistent MCP tools. Includes security enhancements with immutable user objects and new resource sharing framework. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.1.0.md). | 24 June 2025
[3.0.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.0.0.md) | Upgrades to Lucene 10 for improved indexing and vector search. Adds experimental gRPC support and pull-based ingestion from Kafka and Kinesis. Introduces GPU acceleration for vector operations and semantic sentence highlighting. Improves range query performance and hybrid search with z-score normalization. Adds plan-execute-reflect agents and native MCP protocol support for agentic workflows. Enhances security with a new Java agent replacing the Security Manager. Includes PPL query improvements with lookup, join, and subsearch commands. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-3.0.0.md). | 06 May 2025
[2.19.8](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.19.8.md) | Updates the bundled JDK to 21.0.13.1+2 to address CVE-2026-114938, a remote code execution vulnerability in OpenJDK 17 and later. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.19.8.md). | 23 November 2026
[2.19.7](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.19.7.md) | Fixes bugs in alerting, job scheduling, query insights, security, and security analytics. Updates OpenSearch Dashboards dependencies to address CVEs and includes infrastructure and maintenance updates across multiple components. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.19.7.md). | 20 October 2026
[2.19.6](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.19.6.md) | Includes bug fixes, security updates, and infrastructure maintenance across multiple components. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.19.6.md). | 02 July 2026
[2.19.5](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.19.5.md) | Fixes security vulnerabilities with multiple CVE updates across Dashboards plugins including Assistant, Notifications, Observability, and Reporting. Resolves bugs in Alerting, Flow Framework, Security, and k-NN. Includes infrastructure and maintenance updates across multiple components. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.19.5.md). | 10 March 2026
[2.19.4](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.19.4.md) | Fixes critical security vulnerabilities across multiple components including ML Commons, Query Insights Dashboards, and SQL. Resolves bugs in Flow Framework multi-tenancy, Security wildcard matching, and Query Insights time validation. Includes extensive CVE fixes and dependency updates across dashboards plugins. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.19.4.md). | 06 November 2025
[2.19.3](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.19.3.md) | Improves Flow Framework with enhanced memory handling and workflow step processing. Fixes several Query Insights and Query Insights Dashboards issues. Implements security updates across multiple components. Updates infrastructure components and documentation across multiple plugins. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.19.3.md). | 22 July 2025
[2.19.2](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.19.2.md) | Improves query insights with better index handling, a new verbose API parameter, and a default index template. Fixes bugs across Query Insights, Observability, Flow Framework, and Dashboards. Includes multiple CVE fixes, test enhancements, and a new PGP key for artifact verification. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.19.2.md). | 29 April 2025
[2.19.1](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.19.1.md) | Adds execution hint for cardinality aggregator. Includes bug fixes for ML Commons, Query Insights Dashboards, and Remote Metadata SDK. Contains maintenance updates for several components. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.19.1.md). | 27 February 2025
[2.19.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.19.0.md) | Adds workload management, additional query insights, and template queries. Introduces a query insights page to OpenSearch Dashboards. Includes improvements and bug fixes to snapshots, search statistics, star-tree search, and index management. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.19.0.md). | 11 February 2025
[2.18.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.18.0.md) | Adds a redesigned home page, updated Discover interface, and collaborative workspaces to OpenSearch Dashboards. Includes improvements to ML inference processor and query grouping. Introduces reranking by field and paginated CAT APIs. Includes experimental OpenSearch Dashboards Assistant capabilities. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.18.0.md). | 05 November 2024
[2.17.1](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.17.1.md) | Includes bug fixes for ML Commons, anomaly detection, k-NN, and Security Analytics. Adds various infrastructure and maintenance updates. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.17.1.md). | 1 October 2024
[2.17.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.17.0.md) | Includes disk-optimized vector search, binary quantization, and byte vector encoding in k-NN. Adds asynchronous batch ingestion for ML tasks. Provides search and query performance enhancements and a new custom trace source in trace analytics. Includes application-based configuration templates. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.17.0.md). | 17 September 2024
[2.16.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.16.0.md) | Includes built-in byte vector quantization and binary vector support in k-NN. Adds new sort, split, and ML inference search processors for search pipelines. Provides application-based configuration templates and additional plugins to integrate multiple data sources in OpenSearch Dashboards. Includes an experimental Batch Predict ML Commons API. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.16.0.md). | 06 August 2024
[2.15.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.15.0.md) | Includes parallel ingestion processing, SIMD support for exact search, and the ability to disable doc values for the k-NN field. Adds wildcard and derived field types. Improves performance for single-cardinality aggregations, rolling upgrades to remote-backed clusters, and more metrics for top N queries. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.15.0.md). | 25 June 2024
[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](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.14.0.md). | 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](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.13.0.md). | 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](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.12.0.md). | 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](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.11.1.md). | 30 November 2023
[2.11.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.11.0.md) | Adds multimodal and sparse neural search capability and the ability to take shallow snapshots that refer to data stored in remote-backed storage. Makes the search comparison tool generally available. Includes a simplified workflow to create threat detectors in Security Analytics and improved security in OpenSearch Dashboards. Experimental features include a new framework and toolset for distributed tracing and updates to conversational search. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.11.0.md). | 16 October 2023
[2.10.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.10.0.md) | Makes remote-backed storage generally available. Adds hybrid search capability, custom log types for Security Analytics, IP2Geo ingest processor, and delimited term frequency token filter. Includes a new look and feel for OpenSearch Dashboards and updates the Discover tool. Adds Microsoft Teams webhook support for notifications. Experimental features include concurrent segment search and conversational search. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.10.0.md). | 25 September 2023
[2.9.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.9.0.md) | Makes search pipelines and the Neural Search plugin generally available. Adds ML model access control and integration with external ML tools. Implements k-NN byte vectors and efficient filtering with the Faiss engine. Integrates alerting and anomaly detection with OpenSearch Dashboards and adds composite monitors. Adds two new index codec algorithm options. Includes a new ingestion schema for Security Analytics, geoshape aggregations, and extensions---a new mechanism for extending OpenSearch functionality. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.9.0.md). | 24 July 2023
[2.8.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.8.0.md) | Adds cross-cluster query with PPL, search pipelines, an option to turn on segment replication as the default replication type, improved searchable snapshot performance, and Amazon OpenSearch Serverless support with SigV4 authentication for multiple data sources. Includes the UI for the flush, refresh, and clear cache operations in OpenSearch Dashboards. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.8.0.md). | 06 June 2023
[2.7.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.7.0.md) | Includes searchable snapshots and segment replication, which are now generally available. Adds multiple data sources, observability features, dynamic tenant management, component templates, and shape-based map filters in OpenSearch Dashboards. Includes the flat object field type, hot shard identification, and a new automatic reloading mechanism for ML models. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.7.0.md). | 02 May 2023
[2.6.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.6.0.md) | Includes Simple Schema for Observability, index management UI enhancements, Security Analytics enhancements, search backpressure at the coordinating node level, and the ability to add maps to dashboards. Experimental features include a new ML model health dashboard, new text embedding models in ML, and SigV4 authentication in Dashboards. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.6.0.md). | 28 February 2023
[2.5.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.5.0.md) | Includes index management UI enhancements, multi-layer maps, Jaeger support for observability, Debian distributions, returning cluster health by awareness attribute, cluster manager task throttling, weighted zonal search request routing policy, and query string support in index rollups. Experimental features include request-level durability in remote-backed storage and GPU acceleration for ML nodes. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.5.0.md). | 24 January 2023
[2.4.1](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.4.1.md) | Includes maintenance changes and bug fixes for Gradle check and indexing pressure tests. Adds support for skipping changelog. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.4.1.md). | 13 December 2022
[2.4.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.4.0.md) | Includes Windows support, Point-in-time search, custom k-NN filtering, xy_point and xy_shape field types for Cartesian coordinates, GeoHex grid aggregation, and resilience enhancements, including search backpressure. In OpenSearch Dashboards, this release adds snapshot restore functionality, multiple authentication, and aggregate view of saved objects. This release includes the following experimental features: searchable snapshots, Compare Search Results, multiple data sources in OpenSearch Dashboards, a new Model Serving Framework in ML Commons, a new Neural Search plugin that supports semantic search, and a new Security Analytics plugin to analyze security logs. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.4.0.md). | 15 November 2022
[2.3.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.3.0.md) | This release includes the following experimental features: segment replication, remote-backed storage, and drag and drop for OpenSearch Dashboards. Experimental features allow you to test new functionality in OpenSearch. Because these features are still being developed, your testing and feedback can help shape the development of the feature before it's official released. We do not recommend use of experimental features in production. Additionally, this release adds `maketime` and `makedate` `datetime` functions for the SQL plugin. Creates a new [OpenSearch Playground](https://playground.opensearch.org) demo site for OpenSearch Dashboards. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.3.0.md). | 14 September 2022
[2.2.1](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.2.1.md) | Includes Gradle updates and bug fixes for Gradle check. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.2.1.md). | 01 September 2022
[2.2.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.2.0.md) | Includes support for Logistic Regression and RCF Summarize machine learning algorithms in ML Commons, Lucene or C-based NMSLIB and Faiss libraries for approximate k-NN search, search by relevance using SQL and PPL queries, custom region maps for visualizations, and rollup enhancements. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.2.0.md). | 11 August 2022
[2.1.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.1.0.md) | Includes support for dedicated ML node in the ML Commons plugin, relevance search and other features in SQL, multi-terms aggregation, and Snapshot Management. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.1.0.md). | 07 July 2022
[2.0.1](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.0.1.md) | Includes bug fixes and maintenance updates for Alerting and Anomaly Detection. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.0.1.md). | 16 June 2022
[2.0.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.0.0.md) | Includes document-level monitors for alerting, OpenSearch Notifications plugins, and Geo Map Tiles in OpenSearch Dashboards. Also adds support for Lucene 9 and bug fixes for all OpenSearch plugins. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.0.0.md). | 26 May 2022
[2.0.0-rc1](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.0.0-rc1.md) | The Release Candidate for 2.0.0. This version allows you to preview the upcoming 2.0.0 release before the GA release. The preview release adds document-level alerting, support for Lucene 9, and the ability to use term lookup queries in document level security. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-2.0.0-rc1.md). | 03 May 2022
[1.3.20](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.20.md) | Includes enhancements to Anomaly Detection Dashboards, bug fixes for Alerting and Dashboards Reports, and maintenance updates for several OpenSearch components. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.20.md). | 11 December 2024
[1.3.19](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.19.md) | Includes bug fixes and maintenance updates for OpenSearch security, OpenSearch security Dashboards, and anomaly detection. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.19.md). | 27 August 2024
[1.3.18](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.18.md) | Includes maintenance updates for OpenSearch security. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.18.md). | 16 July 2024
[1.3.17](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.17.md) | Includes maintenance updates for OpenSearch security and OpenSearch Dashboards security. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.17.md). | 06 June 2024
[1.3.16](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.16.md) | Includes bug fixes and maintenance updates for OpenSearch security, index management, Performance Analyzer, and reporting. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.16.md). | 23 April 2024
[1.3.15](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.15.md) | Includes bug fixes and maintenance updates for cross-cluster replication, SQL, OpenSearch Dashboards reporting, and alerting. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.15.md). | 05 March 2024
[1.3.14](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.14.md) | Includes bug fixes and maintenance updates for OpenSearch security and OpenSearch Dashboards security. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.14.md). | 12 December 2023
[1.3.13](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.13.md) | Includes bug fixes for Anomaly Detection, adds maintenance updates and infrastructure enhancements. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.13.md). | 21 September 2023
[1.3.12](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.12.md) | Adds maintenance updates for OpenSearch security and OpenSearch Dashboards observability. Includes bug fixes for observability, OpenSearch Dashboards visualizations, and OpenSearch security. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.12.md). | 10 August 2023
[1.3.11](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.11.md) | Adds maintenance updates for OpenSearch security, OpenSearch Dashboards security, and ML Commons. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.11.md). | 29 June 2023
[1.3.10](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.10.md) | Adds infrastructure enhancements and maintenance updates for anomaly detection, observability, and security. Includes bug fixes for index management and OpenSearch security. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.10.md). | 18 May 2023
[1.3.9](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.9.md) | Adds Debian support. Includes upgrades, enhancements, and maintenance updates for OpenSearch core, k-NN, and OpenSearch security. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.9.md). | 16 March 2023
[1.3.8](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.8.md) | Adds OpenSearch security enhancements. Updates tool scripts to run on Windows. Includes maintenance updates and bug fixes for Anomaly Detection and OpenSearch security. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.8.md). | 02 February 2023
[1.3.7](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.7.md) | Adds Windows support. Includes maintenance updates and bug fixes for error handling. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.7.md). | 13 December 2022
[1.3.6](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.6.md) | Includes maintenance updates and bug fixes for tenancy in the OpenSearch Security Dashboards plugin. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.6.md). | 06 October 2022
[1.3.5](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.5.md) | Includes maintenance updates and bug fixes for Gradle check and OpenSearch security. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.5.md). | 01 September 2022
[1.3.4](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.4.md) | Includes maintenance updates and bug fixes for OpenSearch and OpenSearch Dashboards. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.4.md). | 14 July 2022
[1.3.3](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.3.md) | Adds enhancements to Anomaly Detection and ML Commons. Bug fixes for Anomaly Detection, Observability, and k-NN. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.3.md). | 09 June 2022
[1.3.2](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.2.md) | Bug fixes for Anomaly Detection and the Security Dashboards Plugin, adds the option to install OpenSearch using RPM, as well as enhancements to the ML Commons execute task, and the removal of the job-scheduler zip in Anomaly Detection. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.2.md). | 05 May 2022
[1.3.1](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.1.md) | Bug fixes when using document-level security, and adjusted ML Commons to use the latest RCF jar and `protostuff` to RCF model serialization. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.1.md). | 30 March 2022
[1.3.0](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.0.md) | Adds Model Type Validation to Validate Detector API, continuous transforms, custom actions, applied policy parameter to Explain API, default action retries, and new rollover and transition conditions to Index Management, new ML Commons plugin, parse command to SQL, Application Analytics, Live Tail, Correlation, and Events Flyout to Observability, and auto backport and support for OPENSEARCH_JAVA_HOME to Performance Analyzer. Bug fixes. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.3.0.md). | 17 March 2022
[1.2.4](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.2.4.md) | Updates Performance Analyzer, SQL, and Security plugins to Log4j 2.17.1, Alerting and Job Scheduler to cron-utils 9.1.6, and `gson` in Anomaly Detection and SQL. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.2.4.md). | 18 January 2022
[1.2.3](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.2.3.md) | Updates the version of Log4j used in OpenSearch to Log4j 2.17.0 as recommended by the advisory in [CVE-2021-45105](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-45105). For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/blob/main/release-notes/opensearch-release-notes-1.2.3.md). | 22 December 2021
[1.2.0](https://github.com/opensearch-project/OpenSearch/blob/main/release-notes/opensearch.release-notes-1.2.0.md) | Adds observability, new validation API for Anomaly Detection, shard-level indexing backpressure, new `match` query type for SQL and PPL, support for Faiss libraries in k-NN, and custom Dashboards branding. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/OpenSearch/blob/main/release-notes/opensearch.release-notes-1.2.0.md). | 23 November 2021
[1.1.0](https://github.com/opensearch-project/opensearch-build/tree/main/release-notes/opensearch-release-notes-1.1.0.md) | Adds cross-cluster replication, security for Index Management, bucket-level alerting, a CLI to help with upgrading from Elasticsearch OSS to OpenSearch, and enhancements to high cardinality data in the Anomaly Detection plugin. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/tree/main/release-notes/opensearch-release-notes-1.1.0.md). | 05 October 2021
[1.0.1](https://github.com/opensearch-project/opensearch-build/tree/main/release-notes/opensearch-release-notes-1.0.1.md) | Bug fixes. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/tree/main/release-notes/opensearch-release-notes-1.0.1.md). | 01 September 2021
[1.0.0](https://github.com/opensearch-project/opensearch-build/tree/main/release-notes/opensearch-release-notes-1.0.0.md) | General availability release. Adds compatibility setting for clients that require a version check before connecting. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/tree/main/release-notes/opensearch-release-notes-1.0.0.md). | 12 July 2021
[1.0.0-rc1](https://github.com/opensearch-project/opensearch-build/tree/main/release-notes/opensearch-release-notes-1.0.0-rc1.md) | First release candidate. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/tree/main/release-notes/opensearch-release-notes-1.0.0-rc1.md). | 07 June 2021
[1.0.0-beta1](https://github.com/opensearch-project/opensearch-build/tree/main/release-notes/opensearch-release-notes-1.0.0-beta1.md) | Initial beta release. Refactors plugins to work with OpenSearch. For a full list of release highlights, see the [Release Notes](https://github.com/opensearch-project/opensearch-build/tree/main/release-notes/opensearch-release-notes-1.0.0-beta1.md). | 13 May 2021
+98 -52
View File
@@ -2,22 +2,40 @@
layout: default
title: Adjacency matrix
parent: Bucket aggregations
grand_parent: Aggregations
nav_order: 10
redirect_from:
- /query-dsl/aggregations/bucket/adjacency-matrix/
---
# Adjacency matrix aggregations
# Adjacency matrix aggregation
The `adjacency_matrix` aggregation lets you define filter expressions and returns a matrix of the intersecting filters where each non-empty cell in the matrix represents a bucket. You can find how many documents fall within any combination of filters.
The `adjacency_matrix` aggregation accepts a set of named filter expressions and returns buckets representing every pair of intersecting filters. Each bucket's document count indicates how many documents matched both filters simultaneously, making it possible to analyze relationships between different document groups.
Use the `adjacency_matrix` aggregation to discover how concepts are related by visualizing the data as graphs.
Given three filters named `A`, `B`, and `C`, the response produces the following bucket structure:
For example, in the sample eCommerce dataset, to analyze how the different manufacturing companies are related:
| | `A` | `B` | `C` |
| :--- | :--- | :--- | :--- |
| `A` | `A` | `A&B` | `A&C` |
| `B` | | `B` | `B&C` |
| `C` | | | `C` |
The matrix is symmetric---the bucket `A&C` contains the same documents as `C&A`---so only the upper triangle is returned. Filter names are sorted alphabetically, and the name that comes first always appears on the left side of the `&` separator.
## Parameters
The `adjacency_matrix` aggregation takes the following parameters.
| Parameter | Required/Optional | Data type | Description |
| :--- | :--- | :--- | :--- |
| `filters` | Required | Object | A set of named filters expressed as key-value pairs. Each key is the filter name and each value is a query object. |
| `separator` | Optional | String | The character used to join filter names in intersection bucket keys. Default is `&`. |
## Example
The following example analyzes the e-commerce dataset to determine how often products from three manufacturers appear together in the same orders:
```json
GET opensearch_dashboards_sample_data_ecommerce/_search
GET /opensearch_dashboards_sample_data_ecommerce/_search
{
"size": 0,
"aggs": {
@@ -47,55 +65,83 @@ GET opensearch_dashboards_sample_data_ecommerce/_search
```
{% include copy-curl.html %}
#### Example response
## Example response
```json
{
...
"aggregations" : {
"interactions" : {
"buckets" : [
{
"key" : "grpA",
"doc_count" : 1553
},
{
"key" : "grpA&grpB",
"doc_count" : 590
},
{
"key" : "grpA&grpC",
"doc_count" : 329
},
{
"key" : "grpB",
"doc_count" : 1370
},
{
"key" : "grpB&grpC",
"doc_count" : 299
},
{
"key" : "grpC",
"doc_count" : 1218
}
]
}
}
}
```json
{
"took": 32,
"timed_out": false,
"terminated_early": true,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 4675,
"relation": "eq"
},
"max_score": null,
"hits": []
},
"aggregations": {
"interactions": {
"buckets": [
{
"key": "grpA",
"doc_count": 1553
},
{
"key": "grpA&grpB",
"doc_count": 590
},
{
"key": "grpA&grpC",
"doc_count": 329
},
{
"key": "grpB",
"doc_count": 1370
},
{
"key": "grpB&grpC",
"doc_count": 299
},
{
"key": "grpC",
"doc_count": 1218
}
]
}
}
}
```
Let’s take a closer look at the result:
The intersection bucket `grpA&grpB` with `doc_count` of `590` indicates that 590 orders contain products from both Low Tide Media and Elitelligence.
```json
{
"key" : "grpA&grpB",
"doc_count" : 590
}
```
## Usage with child aggregations
- `grpA`: Products manufactured by Low Tide Media.
- `grpB`: Products manufactured by Elitelligence.
- `590`: Number of products that are manufactured by both.
Nesting a child aggregation such as `date_histogram` inside `adjacency_matrix` adds a time dimension to the relationship data, enabling dynamic network analysis where you can observe how interactions between groups evolve over time.
You can use OpenSearch Dashboards to represent this data with a network graph.
Intersection buckets with zero matching documents are omitted from the response.
{: .note}
## Response body fields
The following table lists the response body fields.
| Field | Data type | Description |
| :--- | :--- | :--- |
| `buckets` | Array | A list of buckets representing individual filters and their pairwise intersections. |
| `buckets.key` | String | The filter name for individual filter buckets, or two filter names joined by the separator for intersection buckets. |
| `buckets.doc_count` | Integer | The number of documents matching the filter or filter pair. |
## Limitations
The number of buckets grows quadratically with the number of filters. For `N` filters, up to `N(N+1)/2` buckets are produced (`N` individual buckets plus `N*(N-1)/2` intersection buckets). To prevent excessive memory use, the maximum number of filters defaults to `100`. You can adjust this limit per index using the `index.max_adjacency_matrix_filters` setting.
## Related documentation
- For a complete example of rendering adjacency matrix results as a network graph in OpenSearch Dashboards, see [Creating a Vega visualization]({{site.url}}{{site.baseurl}}/dashboards/visualize/vega/#creating-a-vega-visualization).
File diff suppressed because it is too large Load Diff
+158
View File
@@ -0,0 +1,158 @@
---
layout: default
title: Children
parent: Bucket aggregations
nav_order: 15
---
# Children aggregation
The `children` aggregation is a bucket aggregation that creates a single bucket containing child documents, based on parent-child relationships defined in your index.
The `children` aggregation works with the [join field type]({{site.url}}{{site.baseurl}}/mappings/supported-field-types/join/) to aggregate child documents that are associated with parent documents.
The `children` aggregation identifies child documents that match specific child relation name, whereas the [`parent` aggregation]({{site.url}}{{site.baseurl}}/aggregations/bucket/parent/) identifies parent documents that have matching child documents. Both aggregations take the child relation name as input.
## Parameters
The `children` aggregation takes the following parameters.
| Parameter | Required/Optional | Data type | Description |
| :-- | :-- | :-- | :-- |
| `type` | Required | String | The name of the child type from the join field. This identifies the parent-child relationship to use. |
## Example
The following example builds a small company database with three employees. The employee records each have a child `join` relationship with a parent department record.
First, create a `company` index with a `join` field that maps departments (parents) to employees (children):
```json
PUT /company
{
"mappings": {
"properties": {
"join_field": {
"type": "join",
"relations": {
"department": "employee"
}
},
"department_name": {
"type": "keyword"
},
"employee_name": {
"type": "keyword"
},
"salary": {
"type": "double"
},
"hire_date": {
"type": "date"
}
}
}
}
```
{% include copy-curl.html %}
Next, populate the data with three departments and three employees. The parent-child assignments are presented in the following table.
| Department (parent) | Employees (children) |
| :-- | :-- |
| `Accounting` | `Abel Anderson`, `Betty Billings` |
| `Engineering` | `Carl Carter` |
| `HR` | none |
The `routing` parameter ensures that both parent and child documents are stored on the same shard, which is required in order for parent-child relationships to function correctly in OpenSearch:
```json
POST _bulk?routing=1
{ "create": { "_index": "company", "_id": "1" } }
{ "type": "department", "department_name": "Accounting", "join_field": "department" }
{ "create": { "_index": "company", "_id": "2" } }
{ "type": "department", "department_name": "Engineering", "join_field": "department" }
{ "create": { "_index": "company", "_id": "3" } }
{ "type": "department", "department_name": "HR", "join_field": "department" }
{ "create": { "_index": "company", "_id": "4" } }
{ "type": "employee", "employee_name": "Abel Anderson", "salary": 120000, "hire_date": "2024-04-04", "join_field": { "name": "employee", "parent": "1" } }
{ "create": { "_index": "company", "_id": "5" } }
{ "type": "employee", "employee_name": "Betty Billings", "salary": 140000, "hire_date": "2023-05-05", "join_field": { "name": "employee", "parent": "1" } }
{ "create": { "_index": "company", "_id": "6" } }
{ "type": "employee", "employee_name": "Carl Carter", "salary": 140000, "hire_date": "2020-06-06", "join_field": { "name": "employee", "parent": "2" } }
```
{% include copy-curl.html %}
The following request queries all the departments and then filters for the one named `Accounting`. It then uses the `children` aggregation to select the two documents that have a child relationship with the `Accounting` department. Finally, the `avg` subaggregation returns the average of the `Accounting` employees' salaries:
```json
GET /company/_search
{
"size": 0,
"query": {
"bool": {
"filter": [
{
"term": {
"join_field": "department"
}
},
{
"term": {
"department_name": "Accounting"
}
}
]
}
},
"aggs": {
"acc_employees": {
"children": {
"type": "employee"
},
"aggs": {
"avg_salary": {
"avg": {
"field": "salary"
}
}
}
}
}
}
```
{% include copy-curl.html %}
## Example response
The response returns the selected department bucket, finds the `employee` type children of the department, and computes the `avg` of their salaries:
```json
{
"took": 379,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 1,
"relation": "eq"
},
"max_score": null,
"hits": []
},
"aggregations": {
"acc_employees": {
"doc_count": 2,
"avg_salary": {
"value": 130000
}
}
}
}
```
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+194 -32
View File
@@ -2,32 +2,76 @@
layout: default
title: Diversified sampler
parent: Bucket aggregations
grand_parent: Aggregations
nav_order: 40
redirect_from:
- /query-dsl/aggregations/bucket/diversified-sampler/
---
# Diversified sampler
# Diversified sampler aggregation
The `diversified_sampler` aggregation lets you reduce the bias in the distribution of the sample pool by deduplicating documents containing the same `field`. It does so by using the `max_docs_per_value` and `field` settings, which limit the maximum number of documents collected on a shard for the provided `field`. The `max_docs_per_value` setting is an optional parameter used to determine the maximum number of documents that will be returned per `field`. The default value of this setting is `1`.
The `diversified_sampler` aggregation is a filtering aggregation that limits subaggregation processing to a sample of top-scoring documents while ensuring the sample contains diverse content. It extends the [`sampler` aggregation]({{site.url}}{{site.baseurl}}/aggregations/bucket/sampler/) by deduplicating documents that share a common field value, preventing any single category from dominating the sample.
Similarly to the [`sampler` aggregation]({{site.url}}{{site.baseurl}}/aggregations/bucket/sampler/), you can use the `shard_size` setting to control the maximum number of documents collected on any one shard, as shown in the following example:
Because the sample contains only the top-scoring documents, the subaggregation results focus on the most relevant matches and are not diluted by a long tail of weak matches. This aggregation is also useful when you need to ensure fair representation across different groups---for example, preventing a single prolific author from skewing analytics results or ensuring geographic diversity in location-based analysis. It also reduces the cost of expensive subaggregations like `significant_terms` by producing useful results from a smaller, more representative sample.
## Parameters
The `diversified_sampler` aggregation takes the following parameters.
| Parameter | Required/Optional | Data type | Description |
| :--- | :--- | :--- | :--- |
| `field` | Optional | String | The field used for deduplication. Must produce a single value per document. Either `field` or `script` is required. |
| `script` | Optional | Object | A script that generates the deduplication value. Either `field` or `script` is required. If you specify both, the script acts as a value script and receives the field value as `_value`. |
| `shard_size` | Optional | Integer | The maximum number of top-scoring documents collected on each shard. Default is `100`. |
| `max_docs_per_value` | Optional | Integer | The cap on how many documents sharing the same deduplication value can enter the sample on each shard. Default is `1`, so the sample contains at most one document for each value. |
| `execution_hint` | Optional | String | Controls how deduplication values are managed in memory. See [Execution hint](#execution-hint). |
### Execution hint
The following table lists the valid `execution_hint` values.
| Value | Description |
| :--- | :--- |
| `map` | Holds field values directly in memory. |
| `global_ordinals` | Uses Lucene's ordinal mappings for the field, offering better memory efficiency on high-cardinality fields. |
| `bytes_hash` | Stores a hash of each value rather than the value itself. May improve speed in some scenarios, but if two different values have the same hash, OpenSearch treats them as one value, which can shrink the sample. |
By default, OpenSearch uses `global_ordinals` if the field has ordinals and `map` otherwise. All three options produce the same sample unless `bytes_hash` treats two different values as duplicates because their hashes collide. They differ only in the type of value held in memory, and each option holds up to `shard_size` values. OpenSearch ignores the `execution_hint` if the chosen option does not apply to the field type, and an unrecognized value causes the request to fail.
The `diversified_sampler` aggregation can be nested under a `terms` aggregation. If the `terms` aggregation uses the `breadth_first` collect mode, OpenSearch replays the relevance scores of the deferred documents, so the sample is still based on the top-scoring documents.
{: .note}
## Example: Deduplicating by field
A sample of the top-matching documents can be dominated by a few prolific sources, such as a customer who places many similar orders. In the sample ecommerce data, one customer placed 103 of the 646 orders containing a dress. A plain `sampler` with a `shard_size` of `100` contains orders from only 16 customers.
The following example samples the top-matching orders containing a dress but allows only one order for each `customer_id`, so that the subaggregations reflect many customers equally:
```json
GET opensearch_dashboards_sample_data_logs/_search
GET /opensearch_dashboards_sample_data_ecommerce/_search
{
"size": 0,
"query": {
"match": {
"products.product_name": "dress"
}
},
"aggs": {
"sample": {
"diversified_": {
"shard_size": 1000,
"field": "response.keyword"
"unbiased_sample": {
"diversified_sampler": {
"shard_size": 100,
"field": "customer_id"
},
"aggs": {
"terms": {
"customers": {
"cardinality": {
"field": "customer_id"
}
},
"top_manufacturers": {
"terms": {
"field": "agent.keyword"
"field": "manufacturer.keyword",
"size": 3
}
}
}
@@ -37,30 +81,148 @@ GET opensearch_dashboards_sample_data_logs/_search
```
{% include copy-curl.html %}
#### Example response
The sample contains 22 orders, one from each of the 22 customers who ordered a dress:
<details markdown="block">
<summary>
Response
</summary>
{: .text-delta}
```json
...
"aggregations" : {
"sample" : {
"doc_count" : 3,
"terms" : {
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 0,
"buckets" : [
{
"key" : "Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110421 Firefox/6.0a1",
"doc_count" : 2
},
{
"key" : "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)",
"doc_count" : 1
}
]
{
"aggregations": {
"unbiased_sample": {
"doc_count": 22,
"top_manufacturers": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 17,
"buckets": [
{
"key": "Tigress Enterprises",
"doc_count": 7
},
{
"key": "Low Tide Media",
"doc_count": 6
},
{
"key": "Oceanavigations",
"doc_count": 6
}
]
},
"customers": {
"value": 22
}
}
}
}
}
```
</details>
## Example: Deduplicating by script
Use a script to diversify on a combination of values. The following example allows at most three orders for each combination of `customer_gender` and `day_of_week`:
```json
GET /opensearch_dashboards_sample_data_ecommerce/_search
{
"size": 0,
"query": {
"match": {
"products.product_name": "dress"
}
},
"aggs": {
"unbiased_sample": {
"diversified_sampler": {
"shard_size": 100,
"max_docs_per_value": 3,
"script": {
"lang": "painless",
"source": "doc['customer_gender'].value + '-' + doc['day_of_week'].value"
}
},
"aggs": {
"by_day": {
"terms": {
"field": "day_of_week",
"size": 7
}
}
}
}
}
}
```
{% include copy-curl.html %}
The sample contains 27 orders: at most three for each combination of gender and day of the week. Because each day can contain orders from both female and male customers, some days contain more than three orders:
<details markdown="block">
<summary>
Response
</summary>
{: .text-delta}
```json
{
"aggregations": {
"unbiased_sample": {
"doc_count": 27,
"by_day": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "Thursday",
"doc_count": 5
},
{
"key": "Friday",
"doc_count": 4
},
{
"key": "Sunday",
"doc_count": 4
},
{
"key": "Tuesday",
"doc_count": 4
},
{
"key": "Wednesday",
"doc_count": 4
},
{
"key": "Monday",
"doc_count": 3
},
{
"key": "Saturday",
"doc_count": 3
}
]
}
}
}
}
```
</details>
## Response body fields
The following table lists the response body fields.
| Field | Data type | Description |
| :--- | :--- | :--- |
| `doc_count` | Integer | The total number of documents in the diversified sample. |
## Limitations
The `diversified_sampler` aggregation has the following limitations:
- The `field` or `script` must produce a single value per document. Using a multi-valued field, such as `manufacturer.keyword` in the sample ecommerce data, causes the request to fail. To diversify on all values of a multi-valued field, use a script that combines them into one value, for example, `doc['manufacturer.keyword'].hashCode()`.
- Deduplication is applied independently on each shard, so documents with the same value on different shards are not deduplicated against each other.
- There is no specialized syntax for geographic or date-based diversity values (such as `7d` or `10km`). To diversify by geographic region or time interval, write a script that buckets the raw values---for example, `(int)(doc['geoip.location'].lat / 10)` for latitude bands or `doc['order_date'].value.dayOfWeek` for day-of-week grouping.
+42 -14
View File
@@ -2,20 +2,23 @@
layout: default
title: Filter
parent: Bucket aggregations
grand_parent: Aggregations
nav_order: 50
redirect_from:
- /query-dsl/aggregations/bucket/filter/
---
# Filter aggregations
# Filter aggregation
A `filter` aggregation is a query clause, exactly like a search query — `match` or `term` or `range`. You can use the `filter` aggregation to narrow down the entire set of documents to a specific set before creating buckets.
The `filter` aggregation creates a single bucket containing all documents that match a specified query. Any query clause---`match`, `term`, `range`, `bool`, and others---can serve as the filter. Subaggregations nested inside the `filter` aggregation operate only on the matching documents, making it useful for scoping expensive computations to a relevant subset.
The following example shows the `avg` aggregation running within the context of a filter. The `avg` aggregation only aggregates the documents that match the `range` query:
For filtering documents into multiple named buckets simultaneously, see the [`filters` aggregation]({{site.url}}{{site.baseurl}}/aggregations/bucket/filters/).
## Example
The following example calculates the average order total for all orders under $50 by wrapping an `avg` subaggregation inside a `range` filter:
```json
GET opensearch_dashboards_sample_data_ecommerce/_search
GET /opensearch_dashboards_sample_data_ecommerce/_search
{
"size": 0,
"aggs": {
@@ -40,17 +43,42 @@ GET opensearch_dashboards_sample_data_ecommerce/_search
```
{% include copy-curl.html %}
#### Example response
## Example response
```json
...
"aggregations" : {
"low_value" : {
"doc_count" : 1633,
"avg_amount" : {
"value" : 38.363175998928355
{
"took": 43,
"timed_out": false,
"terminated_early": true,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 4675,
"relation": "eq"
},
"max_score": null,
"hits": []
},
"aggregations": {
"low_value": {
"doc_count": 1633,
"avg_amount": {
"value": 38.363175998928355
}
}
}
}
}
```
```
## Response body fields
The following table lists the response body fields.
| Field | Data type | Description |
| :--- | :--- | :--- |
| `doc_count` | Integer | The number of documents that matched the filter query. |
+110 -50
View File
@@ -2,45 +2,40 @@
layout: default
title: Filters
parent: Bucket aggregations
grand_parent: Aggregations
nav_order: 60
redirect_from:
- /query-dsl/aggregations/bucket/filters/
---
# Filters aggregations
# Filters aggregation
A `filters` aggregation is the same as the `filter` aggregation, except that it lets you use multiple filter aggregations.
While the `filter` aggregation results in a single bucket, the `filters` aggregation returns multiple buckets, one for each of the defined filters.
The `filters` aggregation creates multiple buckets, each associated with a named or anonymous filter query. Every document is evaluated against all filters, and a document can land in multiple buckets if it matches more than one filter. This differs from the singular [`filter` aggregation]({{site.url}}{{site.baseurl}}/aggregations/bucket/filter/), which produces only one bucket.
To create a bucket for all the documents that didn't match the any of the filter queries, set the `other_bucket` property to `true`:
## Parameters
The `filters` aggregation takes the following parameters.
| Parameter | Required/Optional | Data type | Description |
| :--- | :--- | :--- | :--- |
| `filters` | Required | Object or Array | The filter definitions. Provide an object with named keys for labeled buckets, or an array for anonymous (positional) buckets. |
| `other_bucket` | Optional | Boolean | When `true`, adds a bucket containing all documents that did not match any filter. Default is `false`. |
| `other_bucket_key` | Optional | String | The key name for the other bucket. Setting this implicitly enables `other_bucket`. Default is `_other_`. |
## Example: Named filters
When you provide filters as an object, each key becomes the bucket name in the response. The following example groups e-commerce orders into three price tiers:
```json
GET opensearch_dashboards_sample_data_logs/_search
GET /opensearch_dashboards_sample_data_ecommerce/_search
{
"size": 0,
"aggs": {
"200_os": {
"price_ranges": {
"filters": {
"other_bucket": true,
"filters": [
{
"term": {
"response.keyword": "200"
}
},
{
"term": {
"machine.os.keyword": "osx"
}
}
]
},
"aggs": {
"avg_amount": {
"avg": {
"field": "bytes"
}
"filters": {
"budget": { "range": { "taxful_total_price": { "lte": 50 } } },
"mid_range": { "range": { "taxful_total_price": { "gt": 50, "lte": 100 } } },
"premium": { "range": { "taxful_total_price": { "gt": 100 } } }
}
}
}
@@ -49,33 +44,98 @@ GET opensearch_dashboards_sample_data_logs/_search
```
{% include copy-curl.html %}
#### Example response
## Example: Anonymous filters
When you provide filters as an array, buckets are returned in the same order as the array. The following example uses anonymous filters:
```json
...
"aggregations" : {
"200_os" : {
"buckets" : [
{
"doc_count" : 12832,
"avg_amount" : {
"value" : 5897.852711970075
}
},
{
"doc_count" : 2825,
"avg_amount" : {
"value" : 5620.347256637168
}
},
{
"doc_count" : 1017,
"avg_amount" : {
"value" : 3247.0963618485744
GET /opensearch_dashboards_sample_data_ecommerce/_search
{
"size": 0,
"aggs": {
"price_ranges": {
"filters": {
"filters": [
{ "range": { "taxful_total_price": { "lte": 50 } } },
{ "range": { "taxful_total_price": { "gt": 50, "lte": 100 } } }
]
}
}
}
}
```
{% include copy-curl.html %}
## Example: Other bucket
The `other_bucket` parameter captures all documents that did not match any of the defined filters. The following example uses `other_bucket_key` to assign a custom name to the catch-all bucket:
```json
GET /opensearch_dashboards_sample_data_ecommerce/_search
{
"size": 0,
"aggs": {
"price_ranges": {
"filters": {
"other_bucket": true,
"other_bucket_key": "all_others",
"filters": {
"budget": { "range": { "taxful_total_price": { "lte": 50 } } },
"premium": { "range": { "taxful_total_price": { "gt": 100 } } }
}
}
]
}
}
}
}
```
```
{% include copy-curl.html %}
## Example response
The following response corresponds to the other bucket example:
```json
{
"took": 3,
"timed_out": false,
"terminated_early": true,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 4675,
"relation": "eq"
},
"max_score": null,
"hits": []
},
"aggregations": {
"price_ranges": {
"buckets": {
"budget": {
"doc_count": 1633
},
"premium": {
"doc_count": 950
},
"all_others": {
"doc_count": 2092
}
}
}
}
}
```
## Response body fields
The following table lists the response body fields.
| Field | Data type | Description |
| :--- | :--- | :--- |
| `buckets` | Object or Array | An object with named keys when using named filters, or an array of objects when using anonymous filters. |
| `buckets.<key>.doc_count` | Integer | The number of documents matching the filter for this bucket. |
+105 -127
View File
@@ -2,113 +2,48 @@
layout: default
title: Geodistance
parent: Bucket aggregations
grand_parent: Aggregations
nav_order: 70
redirect_from:
- /query-dsl/aggregations/bucket/geo-distance/
---
# Geodistance aggregations
# Geodistance aggregation
The `geo_distance` aggregation groups documents into concentric circles based on distances from an origin `geo_point` field.
It's the same as the `range` aggregation, except that it works on geo locations.
The `geo_distance` aggregation groups documents into distance-based rings around a central point. Each range defines a ring, and documents are placed into buckets based on how far their `geo_point` field value is from the specified origin. This is conceptually similar to the [`range` aggregation]({{site.url}}{{site.baseurl}}/aggregations/bucket/range/) but operates on geographic coordinates rather than numeric values.
For example, you can use the `geo_distance` aggregation to find all pizza places within 1 km of you. The search results are limited to the 1 km radius specified by you, but you can add another result found within 2 km.
The target field must be mapped as `geo_point`. If a document's geo_point field contains multiple values, all distances are evaluated and the document is bucketed accordingly.
You can only use the `geo_distance` aggregation on fields mapped as `geo_point`.
## Parameters
A point is a single geographical coordinate, such as your current location shown by your smart-phone. A point in OpenSearch is represented as follows:
The `geo_distance` aggregation takes the following parameters.
| Parameter | Required/Optional | Data type | Description |
| :--- | :--- | :--- | :--- |
| `field` | Required | String | The `geo_point` field to compute distances from. |
| `origin` | Required | Object, String, or Array | The center point from which distances are measured. Accepts object format (`{"lat": 40.71, "lon": -74.00}`), string format (`"40.71, -74.00"`), or GeoJSON array format (`[-74.00, 40.71]`). |
| `ranges` | Required | Array | A list of distance ranges defining the buckets. Each range can include `from`, `to`, and optionally `key`. |
| `unit` | Optional | String | The unit for distance values in `ranges`. Default is `m` (meters). Valid values: `m`, `km`, `mi`, `yd`, `in`, `cm`, `mm`. |
| `distance_type` | Optional | String | The algorithm used to compute distances. <br>Valid values are:<br> - `arc`: Computes distances using the full spherical geometry of the Earth. Most accurate but slowest. <br> - `plane`: Projects coordinates onto a flat plane and computes Euclidean distances. Fastest but least accurate. Only suitable for small geographic areas (approximately 5 km or less). <br><br>Default is `arc`. |
| `keyed` | Optional | Boolean | When `true`, returns buckets as an object keyed by range name instead of an array. Default is `false`. |
## Example: Basic distance rings
The following example groups e-commerce orders into three distance rings around New York City, measured in miles:
```json
{
"location": {
"type": "point",
"coordinates": {
"lat": 83.76,
"lon": -81.2
}
}
}
```
You can also specify the latitude and longitude as an array `[-81.20, 83.76]` or as a string `"83.76, -81.20"`
This table lists the relevant fields of a `geo_distance` aggregation:
Field | Description | Required
:--- | :--- |:---
`field` | Specify the geopoint field that you want to work on. | Yes
`origin` | Specify the geopoint that's used to compute the distances from. | Yes
`ranges` | Specify a list of ranges to collect documents based on their distance from the target point. | Yes
`unit` | Define the units used in the `ranges` array. The `unit` defaults to `m` (meters), but you can switch to other units like `km` (kilometers), `mi` (miles), `in` (inches), `yd` (yards), `cm` (centimeters), and `mm` (millimeters). | No
`distance_type` | Specify how OpenSearch calculates the distance. The default is `sloppy_arc` (faster but less accurate), but can also be set to `arc` (slower but most accurate) or `plane` (fastest but least accurate). Because of high error margins, use `plane` only for small geographic areas. | No
The syntax is as follows:
```json
{
"aggs": {
"aggregation_name": {
"geo_distance": {
"field": "field_1",
"origin": "x, y",
"ranges": [
{
"to": "value_1"
},
{
"from": "value_2",
"to": "value_3"
},
{
"from": "value_4"
}
]
}
}
}
}
```
This example forms buckets from the following distances from a `geo-point` field:
- Fewer than 10 km
- From 10 to 20 km
- From 20 to 50 km
- From 50 to 100 km
- Above 100 km
```json
GET opensearch_dashboards_sample_data_logs/_search
GET /opensearch_dashboards_sample_data_ecommerce/_search
{
"size": 0,
"aggs": {
"position": {
"distance_from_nyc": {
"geo_distance": {
"field": "geo.coordinates",
"origin": {
"lat": 83.76,
"lon": -81.2
},
"field": "geoip.location",
"origin": "40.7128, -74.0060",
"unit": "mi",
"ranges": [
{
"to": 10
},
{
"from": 10,
"to": 20
},
{
"from": 20,
"to": 50
},
{
"from": 50,
"to": 100
},
{
"from": 100
}
{ "to": 50 },
{ "from": 50, "to": 500 },
{ "from": 500 }
]
}
}
@@ -117,44 +52,87 @@ GET opensearch_dashboards_sample_data_logs/_search
```
{% include copy-curl.html %}
#### Example response
## Example: Keyed response with custom range names
Setting `keyed` to `true` returns buckets as an object instead of an array. You can assign custom names to each range using the `key` property:
```json
...
"aggregations" : {
"position" : {
"buckets" : [
{
"key" : "*-10.0",
"from" : 0.0,
"to" : 10.0,
"doc_count" : 0
},
{
"key" : "10.0-20.0",
"from" : 10.0,
"to" : 20.0,
"doc_count" : 0
},
{
"key" : "20.0-50.0",
"from" : 20.0,
"to" : 50.0,
"doc_count" : 0
},
{
"key" : "50.0-100.0",
"from" : 50.0,
"to" : 100.0,
"doc_count" : 0
},
{
"key" : "100.0-*",
"from" : 100.0,
"doc_count" : 14074
GET /opensearch_dashboards_sample_data_ecommerce/_search
{
"size": 0,
"aggs": {
"distance_from_nyc": {
"geo_distance": {
"field": "geoip.location",
"origin": "40.7128, -74.0060",
"unit": "mi",
"keyed": true,
"ranges": [
{ "to": 50, "key": "local" },
{ "from": 50, "to": 500, "key": "domestic" },
{ "from": 500, "key": "international" }
]
}
]
}
}
}
}
```
```
{% include copy-curl.html %}
## Example response
The following response corresponds to the keyed example:
```json
{
"took": 18,
"timed_out": false,
"terminated_early": true,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 4675,
"relation": "eq"
},
"max_score": null,
"hits": []
},
"aggregations": {
"distance_from_nyc": {
"buckets": {
"local": {
"from": 0.0,
"to": 50.0,
"doc_count": 896
},
"domestic": {
"from": 50.0,
"to": 500.0,
"doc_count": 0
},
"international": {
"from": 500.0,
"doc_count": 3779
}
}
}
}
}
```
## Response body fields
The following table lists the response body fields.
| Field | Data type | Description |
| :--- | :--- | :--- |
| `buckets` | Array or Object | The distance buckets. Returned as an array by default, or as an object when `keyed` is `true`. |
| `buckets.key` | String | The auto-generated range label (for example, `*-500.0` or `500.0-3000.0`), or a custom key if specified. |
| `buckets.from` | Double | The lower bound of the distance range, in the specified `unit`. |
| `buckets.to` | Double | The upper bound of the distance range, in the specified `unit`. |
| `buckets.doc_count` | Integer | The number of documents falling within this distance range. |
+108 -56
View File
@@ -2,28 +2,42 @@
layout: default
title: Geohash grid
parent: Bucket aggregations
grand_parent: Aggregations
nav_order: 80
redirect_from:
- /query-dsl/aggregations/bucket/geohash-grid/
---
# Geohash grid aggregations
# Geohash grid aggregation
The `geohash_grid` aggregation buckets documents for geographical analysis. It organizes a geographical region into a grid of smaller regions of different sizes or precisions. Lower values of precision represent larger geographical areas, and higher values represent smaller, more precise geographical areas. You can aggregate documents on [geopoint]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/geo-point/) or [geoshape]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/geo-shape/) fields using a geohash grid aggregation. One notable difference is that a geopoint is only present in one bucket, but a geoshape is counted in all geohash grid cells with which it intersects.
The `geohash_grid` aggregation groups documents into grid cells based on their [geohash](https://en.wikipedia.org/wiki/Geohash) value. Each cell is labeled with its geohash string, and the precision parameter controls cell size---lower precision values produce fewer, larger cells, while higher values produce many smaller cells. You can aggregate documents on [geo_point]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/geo-point/) or [geo_shape]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/geo-shape/) fields. A geo_point is placed in exactly one cell, while a geo_shape is counted in every cell it intersects.
The number of results returned by a query might be far too many to display each geopoint individually on a map. The `geohash_grid` aggregation buckets nearby geopoints together by calculating the geohash for each point, at the level of precision that you define (between 1 to 12; the default is 5). To learn more about geohash, see [Wikipedia](https://en.wikipedia.org/wiki/Geohash).
Precision values range from 1 to 12. High-precision requests can consume significant memory and produce large responses because they generate many buckets. Filter to a small geographic area before using high precision values.
{: .note}
The web logs example data is spread over a large geographical area, so you can use a lower precision value. You can zoom in on this map by increasing the precision value:
## Parameters
The `geohash_grid` aggregation takes the following parameters.
| Parameter | Required/Optional | Data type | Description |
| :--- | :--- | :--- | :--- |
| `field` | Required | String | The field to aggregate on. Must be mapped as `geo_point` or `geo_shape`. |
| `precision` | Optional | Integer or String | The geohash length controlling cell size. Valid integer values are 1--12. You can also specify an approximate distance (for example, `1km` or `10m`), and OpenSearch selects the precision level whose cells do not exceed that size. Default is `5`. |
| `bounds` | Optional | Object | A bounding box that restricts which points are considered. Only points within the box are aggregated. Accepts all [geo_point formats]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/geo-point#formats). |
| `size` | Optional | Integer | The maximum number of buckets to return. When there are more buckets than `size`, buckets with the highest document counts are returned. Default is `10000`. |
| `shard_size` | Optional | Integer | The maximum number of buckets returned from each shard. Default is max(10, `size` × number of shards). |
## Example: Low-precision grid
The following example groups e-commerce customer locations into geohash cells at precision 4 (approximately 39 km × 19.5 km):
```json
GET opensearch_dashboards_sample_data_logs/_search
GET /opensearch_dashboards_sample_data_ecommerce/_search
{
"size": 0,
"aggs": {
"geo_hash": {
"geohash_grid": {
"field": "geo.coordinates",
"field": "geoip.location",
"precision": 4
}
}
@@ -32,50 +46,100 @@ GET opensearch_dashboards_sample_data_logs/_search
```
{% include copy-curl.html %}
#### Example response
## Example: High-precision grid with bounding box filter
When zooming into a specific region, first filter documents to that area before requesting high precision. The following example uses a `geo_bounding_box` query to narrow to the New York City area, then aggregates at precision 7 (approximately 153 m × 152 m):
```json
...
"aggregations" : {
"geo_hash" : {
"buckets" : [
{
"key" : "c1cg",
"doc_count" : 104
GET /opensearch_dashboards_sample_data_ecommerce/_search
{
"size": 0,
"aggs": {
"zoomed_in": {
"filter": {
"geo_bounding_box": {
"geoip.location": {
"top_left": "41.0, -74.5",
"bottom_right": "40.5, -73.5"
}
}
},
{
"key" : "dr5r",
"doc_count" : 26
},
{
"key" : "9q5b",
"doc_count" : 20
},
{
"key" : "c20g",
"doc_count" : 19
},
{
"key" : "dr70",
"doc_count" : 18
"aggs": {
"detailed_grid": {
"geohash_grid": {
"field": "geoip.location",
"precision": 7
}
}
}
...
]
}
}
}
```
{% include copy-curl.html %}
## Example response
The following response corresponds to the high-precision example:
```json
{
"took": 23,
"timed_out": false,
"terminated_early": true,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 4675,
"relation": "eq"
},
"max_score": null,
"hits": []
},
"aggregations": {
"zoomed_in": {
"doc_count": 896,
"detailed_grid": {
"buckets": [
{
"key": "dr72h56",
"doc_count": 747
},
{
"key": "dr5rs14",
"doc_count": 149
}
]
}
}
}
}
}
```
You can visualize the aggregated response on a map using OpenSearch Dashboards.
## Response body fields
The more accurate you want the aggregation to be, the more resources OpenSearch consumes because of the number of buckets that the aggregation has to calculate. By default, OpenSearch does not generate more than 10,000 buckets. You can change this behavior by using the `size` attribute, but keep in mind that the performance might suffer for very wide queries consisting of thousands of buckets.
The following table lists the response body fields.
| Field | Data type | Description |
| :--- | :--- | :--- |
| `buckets` | Array | The grid cell buckets, ordered by `doc_count` descending. |
| `buckets.key` | String | The geohash string identifying the cell. |
| `buckets.doc_count` | Integer | The number of documents (or geoshape intersections) in this cell. |
You can use a returned geohash key as both the `top_left` and `bottom_right` of a `geo_bounding_box` query to zoom into that cell at a higher precision. Client-side geohash libraries (such as [ngeohash](https://github.com/sunng87/node-geohash) for JavaScript) can decode bucket keys into lat/lon bounding boxes for map rendering.
{: .tip}
## Aggregating geoshapes
To run an aggregation on a geoshape field, first create an index and map the `location` field as a `geo_shape`:
```json
PUT national_parks
PUT /national_parks
{
"mappings": {
"properties": {
@@ -91,7 +155,7 @@ PUT national_parks
Next, index some documents into the `national_parks` index:
```json
PUT national_parks/_doc/1
PUT /national_parks/_doc/1
{
"name": "Yellowstone National Park",
"location":
@@ -101,7 +165,7 @@ PUT national_parks/_doc/1
{% include copy-curl.html %}
```json
PUT national_parks/_doc/2
PUT /national_parks/_doc/2
{
"name": "Yosemite National Park",
"location":
@@ -111,7 +175,7 @@ PUT national_parks/_doc/2
{% include copy-curl.html %}
```json
PUT national_parks/_doc/3
PUT /national_parks/_doc/3
{
"name": "Death Valley National Park",
"location":
@@ -123,7 +187,7 @@ PUT national_parks/_doc/3
You can run an aggregation on the `location` field as follows:
```json
GET national_parks/_search
GET /national_parks/_search
{
"aggregations": {
"grouped": {
@@ -137,7 +201,7 @@ GET national_parks/_search
```
{% include copy-curl.html %}
When aggregating geoshapes, one geoshape can be counted for multiple buckets because it overlaps multiple grid cells:
A geoshape can appear in multiple buckets when it spans more than one grid cell:
<details open markdown="block">
<summary>
@@ -245,24 +309,12 @@ When aggregating geoshapes, one geoshape can be counted for multiple buckets bec
```
</details>
Currently, OpenSearch supports geoshape aggregation through the API but not in OpenSearch Dashboards visualizations. If you'd like to see geoshape aggregation implemented for visualizations, upvote the related [GitHub issue](https://github.com/opensearch-project/dashboards-maps/issues/250).
OpenSearch supports geoshape aggregation through the API but not in OpenSearch Dashboards visualizations.
{: .note}
## Supported parameters
Geohash grid aggregation requests support the following parameters.
Parameter | Data type | Description
:--- | :--- | :---
field | String | The field on which aggregation is performed. This field must be mapped as a `geo_point` or `geo_shape` field. If the field contains an array, all array values are aggregated. Required.
precision | Integer | The granularity level used to determine grid cells for bucketing results. Cells cannot exceed the specified size (diagonal) of the required precision. Valid values are in the [0, 12] range. Optional. Default is 5.
bounds | Object | The bounding box for filtering geopoints and geoshapes. The bounding box is defined by the upper-left and lower-right vertices. Only shapes that intersect with this bounding box or are completely enclosed by this bounding box are included in the aggregation output. The vertices are specified as geopoints in one of the following formats: <br>- An object with a latitude and longitude<br>- An array in the [`longitude`, `latitude`] format<br>- A string in the "`latitude`,`longitude`" format<br>- A geohash <br>- WKT<br> See the [geopoint formats]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/geo-point#formats) for formatting examples. Optional.
size | Integer | The maximum number of buckets to return. When there are more buckets than `size`, OpenSearch returns buckets with more documents. Optional. Default is 10,000.
shard_size | Integer | The maximum number of buckets to return from each shard. Optional. Default is max (10, `size` &middot; number of shards), which provides a more accurate count of more highly prioritized buckets.
## Geohash precision
The relationship between geohash precision and the approximate grid cell dimensions is described in the following table.
The following table lists the approximate cell dimensions at each precision level. Cell dimensions vary with latitude; the values shown represent the widest case at the equator.
Precision /<br>geohash length | Latitude bits | Longitude bits | Latitude error | Longitude error | Cell height | Cell width
:---:|:-------------:|:--------------:|:--------------:|:---------------:|:-----------:|:----------:
@@ -277,4 +329,4 @@ Precision /<br>geohash length | Latitude bits | Longitude bits | Latitude error
9 | 22 | 23 | ±0.000021 | ±0.000021 | 4.8 m | 4.8 m
10 | 25 | 25 | ±0.00000268 | ±0.00000536 | 59.5 cm | 1.2 m
11 | 27 | 28 | ±0.00000067 | ±0.00000067 | 14.9 cm | 14.9 cm
12 | 30 | 30 | ±0.00000008 | ±0.00000017 | 1.9 cm | 3.7 cm
12 | 30 | 30 | ±0.00000008 | ±0.00000017 | 1.9 cm | 3.7 cm
+7 -6
View File
@@ -2,15 +2,16 @@
layout: default
title: Geohex grid
parent: Bucket aggregations
grand_parent: Aggregations
nav_order: 85
redirect_from:
- /opensearch/geohexgrid-agg/
- /query-dsl/aggregations/geohexgrid-agg/
- /aggregations/geohexgrid/
- /query-dsl/aggregations/geohexgrid/
- /query-dsl/aggregations/bucket/geohex-grid/
---
# Geohex grid aggregations
# Geohex grid aggregation
The Hexagonal Hierarchical Geospatial Indexing System (H3) partitions the Earth's areas into identifiable hexagon-shaped cells.
@@ -387,7 +388,7 @@ Geohex grid aggregation requests support the following parameters.
Parameter | Data type | Description
:--- | :--- | :---
field | String | The field that contains the geopoints. This field must be mapped as a `geo_point` field. If the field contains an array, all array values are aggregated. Required.
precision | Integer | The granularity level used to determine grid cells for bucketing results. Cells cannot exceed the specified size (diagonal) of the required precision. Valid values are in the [0, 15] range. Optional. Default is 5.
bounds | Object | The bounding box for filtering geopoints. The bounding box is defined by the upper-left and lower-right vertices. The vertices are specified as geopoints in one of the following formats: <br>- An object with a latitude and longitude<br>- An array in the [`longitude`, `latitude`] format<br>- A string in the "`latitude`,`longitude`" format<br>- A geohash <br>- WKT<br> See the [geopoint formats]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/geo-point#formats) for formatting examples. Optional.
size | Integer | The maximum number of buckets to return. When there are more buckets than `size`, OpenSearch returns buckets with more documents. Optional. Default is 10,000.
shard_size | Integer | The maximum number of buckets to return from each shard. Optional. Default is max (10, `size` &middot; number of shards), which provides a more accurate count of more highly prioritized buckets.
`precision` | Integer | The granularity level used to determine grid cells for bucketing results. Cells cannot exceed the specified size (diagonal) of the required precision. Valid values are in the [0, 15] range. Optional. Default is 5.
`bounds` | Object | The bounding box for filtering geopoints. The bounding box is defined by the upper-left and lower-right vertices. The vertices are specified as geopoints in one of the following formats: <br>- An object with a latitude and longitude<br>- An array in the [`longitude`, `latitude`] format<br>- A string in the "`latitude`,`longitude`" format<br>- A geohash <br>- WKT<br> See the [geopoint formats]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/geo-point#formats) for formatting examples. Optional.
`size` | Integer | The maximum number of buckets to return. When there are more buckets than `size`, OpenSearch returns buckets with more documents. Optional. Default is 10,000.
`shard_size` | Integer | The maximum number of buckets to return from each shard. Optional. Default is max (10, `size` &middot; number of shards), which provides a more accurate count of more highly prioritized buckets.
+7 -8
View File
@@ -2,15 +2,14 @@
layout: default
title: Geotile grid
parent: Bucket aggregations
grand_parent: Aggregations
nav_order: 87
redirect_from:
- /query-dsl/aggregations/bucket/geotile-grid/
---
# Geotile grid aggregations
# Geotile grid aggregation
The geotile grid aggregation groups documents into grid cells for geographical analysis. Each grid cell corresponds to a [map tile](https://en.wikipedia.org/wiki/Tiled_web_map) and is identified using the `{zoom}/{x}/{y}` format. You can aggregate documents on [geopoint]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/geo-point/) or [geoshape]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/geo-shape/) fields using a geotile grid aggregation. One notable difference is that a geopoint is only present in one bucket, but a geoshape is counted in all geotile grid cells with which it intersects.
The geotile grid aggregation groups documents into grid cells for geographical analysis. Each grid cell corresponds to a [map tile](https://en.wikipedia.org/wiki/Tiled_web_map) and is identified using the `{zoom}/{x}/{y}` format. You can aggregate documents on [geopoint]({{site.url}}{{site.baseurl}}/mappings/supported-field-types/geo-point/) or [geoshape]({{site.url}}{{site.baseurl}}/mappings/supported-field-types/geo-shape/) fields using a geotile grid aggregation. One notable difference is that a geopoint is only present in one bucket, but a geoshape is counted in all geotile grid cells with which it intersects.
## Precision
@@ -534,7 +533,7 @@ When aggregating geoshapes, one geoshape can be counted for multiple buckets bec
```
</details>
Currently, OpenSearch supports geoshape aggregation through the API but not in OpenSearch Dashboards visualizations. If you'd like to see geoshape aggregation implemented for visualizations, upvote the related [GitHub issue](https://github.com/opensearch-project/dashboards-maps/issues/250).
OpenSearch supports geoshape aggregation through the API but not in OpenSearch Dashboards visualizations. If you'd like to see geoshape aggregation implemented for visualizations, upvote the related [GitHub issue](https://github.com/opensearch-project/dashboards-maps/issues/250).
{: .note}
## Supported parameters
@@ -544,7 +543,7 @@ Geotile grid aggregation requests support the following parameters.
Parameter | Data type | Description
:--- | :--- | :---
field | String | The field that contains the geopoints. This field must be mapped as a `geo_point` field. If the field contains an array, all array values are aggregated. Required.
precision | Integer | The granularity level used to determine grid cells for bucketing results. Cells cannot exceed the specified size (diagonal) of the required precision. Valid values are in the [0, 29] range. Optional. Default is 7.
bounds | Object | The bounding box for filtering geopoints. The bounding box is defined by the upper-left and lower-right vertices. The vertices are specified as geopoints in one of the following formats: <br>- An object with a latitude and longitude<br>- An array in the [`longitude`, `latitude`] format<br>- A string in the "`latitude`,`longitude`" format<br>- A geohash <br>- WKT<br> See the [geopoint formats]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/geo-point#formats) for formatting examples. Optional.
size | Integer | The maximum number of buckets to return. When there are more buckets than `size`, OpenSearch returns buckets with more documents. Optional. Default is 10,000.
shard_size | Integer | The maximum number of buckets to return from each shard. Optional. Default is max (10, `size` &middot; number of shards), which provides a more accurate count of more highly prioritized buckets.
`precision` | Integer | The granularity level used to determine grid cells for bucketing results. Cells cannot exceed the specified size (diagonal) of the required precision. Valid values are in the [0, 29] range. Optional. Default is 7.
`bounds` | Object | The bounding box for filtering geopoints. The bounding box is defined by the upper-left and lower-right vertices. The vertices are specified as geopoints in one of the following formats: <br>- An object with a latitude and longitude<br>- An array in the [`longitude`, `latitude`] format<br>- A string in the "`latitude`,`longitude`" format<br>- A geohash <br>- WKT<br> See the [geopoint formats]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/geo-point#formats) for formatting examples. Optional.
`size` | Integer | The maximum number of buckets to return. When there are more buckets than `size`, OpenSearch returns buckets with more documents. Optional. Default is 10,000.
`shard_size` | Integer | The maximum number of buckets to return from each shard. Optional. Default is max (10, `size` &middot; number of shards), which provides a more accurate count of more highly prioritized buckets.
+50 -14
View File
@@ -2,20 +2,24 @@
layout: default
title: Global
parent: Bucket aggregations
grand_parent: Aggregations
nav_order: 90
redirect_from:
- /query-dsl/aggregations/bucket/global/
---
# Global aggregations
# Global aggregation
The `global` aggregations lets you break out of the aggregation context of a filter aggregation. Even if you have included a filter query that narrows down a set of documents, the `global` aggregation aggregates on all documents as if the filter query wasn't there. It ignores the `filter` aggregation and implicitly assumes the `match_all` query.
The `global` aggregation creates a single bucket containing all documents in the index, regardless of the search query. Subaggregations nested inside `global` operate on the full document set, allowing you to compare filtered metrics against overall metrics in the same request.
The following example returns the `avg` value of the `taxful_total_price` field from all documents in the index:
The `global` aggregation can only be placed as a top-level aggregation. Nesting it inside another bucket aggregation has no effect.
{: .note}
## Example
The following example computes two averages in a single request: one scoped to the query (orders under $50) and one across all documents using the `global` aggregation:
```json
GET opensearch_dashboards_sample_data_ecommerce/_search
GET /opensearch_dashboards_sample_data_ecommerce/_search
{
"size": 0,
"query": {
@@ -35,25 +39,57 @@ GET opensearch_dashboards_sample_data_ecommerce/_search
}
}
}
},
"filtered_avg": {
"avg": {
"field": "taxful_total_price"
}
}
}
}
```
{% include copy-curl.html %}
#### Example response
## Example response
```json
...
"aggregations" : {
"total_avg_amount" : {
"doc_count" : 4675,
"avg_price" : {
"value" : 75.05542864304813
{
"took": 19,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 1633,
"relation": "eq"
},
"max_score": null,
"hits": []
},
"aggregations": {
"total_avg_amount": {
"doc_count": 4675,
"avg_price": {
"value": 75.05542864304813
}
},
"filtered_avg": {
"value": 38.363175998928355
}
}
}
}
```
You can see that the average value for the `taxful_total_price` field is 75.05 and not the 38.36 as seen in the `filter` example when the query matched.
The `total_avg_amount` aggregation reports the average across all 4,675 documents ($75.06), while `filtered_avg` reports the average only for the 1,633 documents matching the query ($38.36).
## Response body fields
The following table lists the response body fields.
| Field | Data type | Description |
| :--- | :--- | :--- |
| `doc_count` | Integer | The total number of documents in the index, independent of the search query. |
+121 -23
View File
@@ -2,29 +2,48 @@
layout: default
title: Histogram
parent: Bucket aggregations
grand_parent: Aggregations
nav_order: 100
redirect_from:
- /query-dsl/aggregations/bucket/histogram/
---
# Histogram aggregations
# Histogram aggregation
The `histogram` aggregation buckets documents based on a specified interval.
The `histogram` aggregation divides a numeric field's value range into fixed-width intervals and counts documents in each interval. Each bucket's `key` represents the lower bound of that interval, computed as `Math.floor((value - offset) / interval) * interval + offset`.
With `histogram` aggregations, you can visualize the distributions of values in a given range of documents very easily. Now OpenSearch doesn’t give you back an actual graph of course, that’s what OpenSearch Dashboards is for. But it'll give you the JSON response that you can use to construct your own graph.
## Parameters
The following example buckets the `number_of_bytes` field by 10,000 intervals:
The `histogram` aggregation takes the following parameters.
| Parameter | Required/Optional | Data type | Description |
| :--- | :--- | :--- | :--- |
| `field` | Required | String | The numeric field to aggregate on. |
| `interval` | Required | Number | The width of each bucket. Must be a positive value. |
| `min_doc_count` | Optional | Integer | The minimum number of documents required for a bucket to appear in the response. Set to `1` to omit empty buckets. Default is `0` (empty buckets are included). |
| `extended_bounds` | Optional | Object | Guarantees that buckets exist from `min` to `max`, even if no documents fall in that range. Does not filter out buckets beyond the bounds---to exclude buckets outside a range, use `hard_bounds` or a range query. Accepts `min` and `max` values. Only meaningful when `min_doc_count` is `0`. |
| `hard_bounds` | Optional | Object | Limits the range of buckets in the response. Accepts `min` and `max` values. Buckets outside these bounds are excluded. |
| `offset` | Optional | Number | Shifts bucket boundaries by the specified amount. Must be in the range [0, `interval`). Default is `0`. |
| `keyed` | Optional | Boolean | When `true`, returns buckets as an object keyed by bucket value instead of an array. Default is `false`. |
| `order` | Optional | Object | Controls the sort order of buckets. Accepts `_key` or `_count`, each with `asc` or `desc`. Default is `{"_key": "asc"}`. |
| `missing` | Optional | Number | The value to assign to documents missing the target field, placing them in the corresponding bucket. By default, missing documents are ignored. |
When aggregating a [numeric range field]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/range/) rather than a single-value numeric field, a document can appear in multiple buckets---one for each interval between its lower and upper bounds.
{: .note}
## Example: Basic histogram
The following example groups e-commerce order totals into $50 intervals, showing only buckets that contain at least one document:
```json
GET opensearch_dashboards_sample_data_logs/_search
GET /opensearch_dashboards_sample_data_ecommerce/_search
{
"size": 0,
"aggs": {
"number_of_bytes": {
"price_histogram": {
"histogram": {
"field": "bytes",
"interval": 10000
"field": "taxful_total_price",
"interval": 50,
"min_doc_count": 1
}
}
}
@@ -32,23 +51,102 @@ GET opensearch_dashboards_sample_data_logs/_search
```
{% include copy-curl.html %}
#### Example response
## Example: Using offset to shift bucket boundaries
The `offset` parameter shifts where bucket boundaries start. The following example uses an offset of `10`, so buckets start at 10, 60, 110, and so on instead of 0, 50, 100:
```json
...
"aggregations" : {
"number_of_bytes" : {
"buckets" : [
{
"key" : 0.0,
"doc_count" : 13372
},
{
"key" : 10000.0,
"doc_count" : 702
GET /opensearch_dashboards_sample_data_ecommerce/_search
{
"size": 0,
"aggs": {
"price_histogram": {
"histogram": {
"field": "taxful_total_price",
"interval": 50,
"offset": 10,
"min_doc_count": 1
}
]
}
}
}
}
```
{% include copy-curl.html %}
## Example response
The following response corresponds to the basic histogram example:
```json
{
"took": 2,
"timed_out": false,
"terminated_early": true,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 4675,
"relation": "eq"
},
"max_score": null,
"hits": []
},
"aggregations": {
"price_histogram": {
"buckets": [
{
"key": 0.0,
"doc_count": 1633
},
{
"key": 50.0,
"doc_count": 2036
},
{
"key": 100.0,
"doc_count": 724
},
{
"key": 150.0,
"doc_count": 205
},
{
"key": 200.0,
"doc_count": 53
},
{
"key": 250.0,
"doc_count": 14
},
{
"key": 300.0,
"doc_count": 7
},
{
"key": 350.0,
"doc_count": 2
},
{
"key": 2250.0,
"doc_count": 1
}
]
}
}
}
```
## Response body fields
The following table lists the response body fields.
| Field | Data type | Description |
| :--- | :--- | :--- |
| `buckets` | Array or Object | The histogram buckets. Returned as an array by default, or as an object when `keyed` is `true`. |
| `buckets.key` | Double | The lower bound of the bucket interval. |
| `buckets.doc_count` | Integer | The number of documents in the bucket. |
+7 -1
View File
@@ -9,6 +9,7 @@ redirect_from:
- /query-dsl/aggregations/bucket-agg/
- /query-dsl/aggregations/bucket/
- /aggregations/bucket-agg/
- /aggregations/bucket/
---
# Bucket aggregations
@@ -22,6 +23,8 @@ You can use bucket aggregations to implement faceted navigation (usually placed
OpenSearch supports the following bucket aggregations:
- [Adjacency matrix]({{site.url}}{{site.baseurl}}/aggregations/bucket/adjacency-matrix/)
- [Auto-interval date histogram]({{site.url}}{{site.baseurl}}/aggregations/bucket/auto-interval-date-histogram/)
- [Children]({{site.url}}{{site.baseurl}}/aggregations/bucket/children/)
- [Date histogram]({{site.url}}{{site.baseurl}}/aggregations/bucket/date-histogram/)
- [Date range]({{site.url}}{{site.baseurl}}/aggregations/bucket/date-range/)
- [Diversified sampler]({{site.url}}{{site.baseurl}}/aggregations/bucket/diversified-sampler/)
@@ -37,9 +40,12 @@ OpenSearch supports the following bucket aggregations:
- [Missing]({{site.url}}{{site.baseurl}}/aggregations/bucket/missing/)
- [Multi-terms]({{site.url}}{{site.baseurl}}/aggregations/bucket/multi-terms/)
- [Nested]({{site.url}}{{site.baseurl}}/aggregations/bucket/nested/)
- [Parent]({{site.url}}{{site.baseurl}}/aggregations/bucket/parent/)
- [Range]({{site.url}}{{site.baseurl}}/aggregations/bucket/range/)
- [Rare terms]({{site.url}}{{site.baseurl}}/aggregations/bucket/rare-terms/)
- [Reverse nested]({{site.url}}{{site.baseurl}}/aggregations/bucket/reverse-nested/)
- [Sampler]({{site.url}}{{site.baseurl}}/aggregations/bucket/sampler/)
- [Significant terms]({{site.url}}{{site.baseurl}}/aggregations/bucket/significant-terms/)
- [Significant text]({{site.url}}{{site.baseurl}}/aggregations/bucket/significant-text/)
- [Terms]({{site.url}}{{site.baseurl}}/aggregations/bucket/terms/)
- [Terms]({{site.url}}{{site.baseurl}}/aggregations/bucket/terms/)
- [Variable width histogram]({{site.url}}{{site.baseurl}}/aggregations/bucket/variable-width-histogram/)
+155 -46
View File
@@ -2,33 +2,85 @@
layout: default
title: IP range
parent: Bucket aggregations
grand_parent: Aggregations
nav_order: 110
redirect_from:
- /query-dsl/aggregations/bucket/ip-range/
---
# IP range aggregations
# IP range aggregation
The `ip_range` aggregation is for IP addresses.
It works on `ip` type fields. You can define the IP ranges and masks in the [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) notation.
The `ip_range` aggregation groups documents into buckets based on IP address ranges. It operates on fields mapped as `ip` type and supports both explicit `from`/`to` boundaries and [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) notation using the `mask` parameter.
## Parameters
The `ip_range` aggregation takes the following parameters.
| Parameter | Required/Optional | Data type | Description |
| :--- | :--- | :--- | :--- |
| `field` | Required | String | The `ip` field to aggregate on. |
| `ranges` | Required | Array | A list of IP ranges. Each range can specify `from` and/or `to` (explicit boundaries), or `mask` (CIDR notation). Optionally include `key` to name the bucket. |
| `keyed` | Optional | Boolean | When `true`, returns buckets as an object keyed by range name instead of an array. Default is `false`. |
## Example setup
To try the examples on this page, create an index containing an `ip` field:
```json
GET opensearch_dashboards_sample_data_logs/_search
PUT /network_logs
{
"mappings": {
"properties": {
"ip": { "type": "ip" },
"status": { "type": "keyword" }
}
}
}
```
{% include copy-curl.html %}
Index some documents:
```json
POST /network_logs/_bulk?refresh=true
{"index":{}}
{"ip": "10.0.0.1", "status": "ok"}
{"index":{}}
{"ip": "10.0.0.50", "status": "ok"}
{"index":{}}
{"ip": "10.0.0.100", "status": "error"}
{"index":{}}
{"ip": "10.0.0.200", "status": "ok"}
{"index":{}}
{"ip": "10.0.1.5", "status": "ok"}
{"index":{}}
{"ip": "10.0.1.100", "status": "error"}
{"index":{}}
{"ip": "172.16.0.1", "status": "ok"}
{"index":{}}
{"ip": "172.16.0.50", "status": "ok"}
{"index":{}}
{"ip": "192.168.1.1", "status": "ok"}
{"index":{}}
{"ip": "192.168.1.100", "status": "error"}
```
{% include copy-curl.html %}
## Example: Explicit IP ranges
The following example partitions network log entries into three IP ranges using `from` and `to` boundaries:
```json
GET /network_logs/_search
{
"size": 0,
"aggs": {
"access": {
"ip_ranges": {
"ip_range": {
"field": "ip",
"ranges": [
{
"from": "1.0.0.0",
"to": "126.158.155.183"
},
{
"mask": "1.0.0.0/8"
}
{ "to": "10.0.1.0" },
{ "from": "10.0.1.0", "to": "172.16.0.0" },
{ "from": "172.16.0.0" }
]
}
}
@@ -37,41 +89,98 @@ GET opensearch_dashboards_sample_data_logs/_search
```
{% include copy-curl.html %}
#### Example response
The buckets are returned as an array with auto-generated keys based on the range boundaries. The `from` value is inclusive and the `to` value is exclusive:
```json
...
"aggregations" : {
"access" : {
"buckets" : [
{
"key" : "1.0.0.0/8",
"from" : "1.0.0.0",
"to" : "2.0.0.0",
"doc_count" : 98
},
{
"key" : "1.0.0.0-126.158.155.183",
"from" : "1.0.0.0",
"to" : "126.158.155.183",
"doc_count" : 7184
}
]
}
}
}
```
If you add a document with malformed fields to an index that has `ip_range` set to `false` in its mappings, OpenSearch rejects the entire document. You can set `ignore_malformed` to `true` to specify that OpenSearch should ignore malformed fields. The default is `false`.
```json
...
"mappings": {
"properties": {
"ips": {
"type": "ip_range",
"ignore_malformed": true
{
...
"aggregations": {
"ip_ranges": {
"buckets": [
{
"key": "*-10.0.1.0",
"to": "10.0.1.0",
"doc_count": 4
},
{
"key": "10.0.1.0-172.16.0.0",
"from": "10.0.1.0",
"to": "172.16.0.0",
"doc_count": 2
},
{
"key": "172.16.0.0-*",
"from": "172.16.0.0",
"doc_count": 4
}
]
}
}
}
```
```
## Example: CIDR masks with keyed response
You can define ranges using CIDR notation and assign custom keys. Setting `keyed` to `true` returns an object instead of an array. The following example groups traffic by RFC 1918 private address classes:
```json
GET /network_logs/_search
{
"size": 0,
"aggs": {
"ip_ranges": {
"ip_range": {
"field": "ip",
"ranges": [
{ "key": "private_a", "mask": "10.0.0.0/8" },
{ "key": "private_b", "mask": "172.16.0.0/12" },
{ "key": "private_c", "mask": "192.168.0.0/16" }
],
"keyed": true
}
}
}
}
```
{% include copy-curl.html %}
With CIDR notation, the response includes the computed `from` and `to` boundaries derived from the mask. Because `keyed` is `true`, buckets are returned as an object with custom keys instead of an array:
```json
{
...
"aggregations": {
"ip_ranges": {
"buckets": {
"private_a": {
"from": "10.0.0.0",
"to": "11.0.0.0",
"doc_count": 6
},
"private_b": {
"from": "172.16.0.0",
"to": "172.32.0.0",
"doc_count": 2
},
"private_c": {
"from": "192.168.0.0",
"to": "192.169.0.0",
"doc_count": 2
}
}
}
}
}
```
## Response body fields
The following table lists the response body fields.
| Field | Data type | Description |
| :--- | :--- | :--- |
| `buckets` | Array or Object | The IP range buckets. Returned as an array by default, or as an object when `keyed` is `true`. |
| `buckets.key` | String | The auto-generated range label (for example, `*-10.0.1.0` or `10.0.0.0/24`), or a custom key if specified. |
| `buckets.from` | String | The lower bound IP address of the range (inclusive). |
| `buckets.to` | String | The upper bound IP address of the range (exclusive). |
| `buckets.doc_count` | Integer | The number of documents with an IP address in this range. |
+62 -49
View File
@@ -2,28 +2,58 @@
layout: default
title: Missing
parent: Bucket aggregations
grand_parent: Aggregations
nav_order: 120
redirect_from:
- /query-dsl/aggregations/bucket/missing/
---
# Missing aggregations
# Missing aggregation
If you have documents in your index that don’t contain the aggregating field at all or the aggregating field has a value of NULL, use the `missing` parameter to specify the name of the bucket such documents should be placed in.
The `missing` aggregation creates a single bucket containing all documents that do not have a value for a specified field. A document is considered missing if the field is absent, `null`, or an empty array. If the field mapping defines a [`null_value`]({{site.url}}{{site.baseurl}}/mappings/mapping-parameters/null-value/), explicit `null` values are indexed as that value and are not counted as missing. This aggregation is commonly paired with other bucket aggregations to account for documents that cannot be placed in any other bucket because they lack the required field.
The following example adds any missing values to a bucket named "N/A":
## Parameters
The `missing` aggregation takes the following parameters.
| Parameter | Required/Optional | Data type | Description |
| :--- | :--- | :--- | :--- |
| `field` | Required | String | The field to check for missing values. |
If the specified field is not mapped in the index, every document is counted as missing, and no error is returned. A misspelled field name therefore produces a bucket containing all documents. If the `doc_count` equals the total number of documents, verify the field name.
{: .note}
## Example
The following request indexes three products into a `product_ratings` index. Product C has no `rating` field:
```json
GET opensearch_dashboards_sample_data_logs/_search
POST product_ratings/_bulk?refresh
{ "index": { "_id": "1" } }
{ "name": "Product A", "rating": 4.5, "num_reviews": 100 }
{ "index": { "_id": "2" } }
{ "name": "Product B", "rating": 3.8, "num_reviews": 50 }
{ "index": { "_id": "3" } }
{ "name": "Product C" }
```
{% include copy-curl.html %}
The following aggregation counts how many products are missing a rating and includes a `terms` subaggregation to identify them:
```json
GET /product_ratings/_search
{
"size": 0,
"aggs": {
"response_codes": {
"terms": {
"field": "response.keyword",
"size": 10,
"missing": "N/A"
"without_rating": {
"missing": {
"field": "rating"
},
"aggs": {
"names": {
"terms": {
"field": "name.keyword"
}
}
}
}
}
@@ -31,52 +61,35 @@ 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:
## Example response
The response shows that one product (Product C) is missing the `rating` field:
```json
GET opensearch_dashboards_sample_data_logs/_search
{
"size": 0,
"aggs": {
"response_codes": {
"terms": {
"field": "response.keyword",
"size": 10,
"missing": "N/A",
"min_doc_count": 0
...
"aggregations": {
"without_rating": {
"doc_count": 1,
"names": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "Product C",
"doc_count": 1
}
]
}
}
}
}
```
#### Example response
## Response body fields
```json
...
"aggregations" : {
"response_codes" : {
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 0,
"buckets" : [
{
"key" : "200",
"doc_count" : 12832
},
{
"key" : "404",
"doc_count" : 801
},
{
"key" : "503",
"doc_count" : 441
},
{
"key" : "N/A",
"doc_count" : 0
}
]
}
}
}
```
The following table lists the response body fields.
| Field | Data type | Description |
| :--- | :--- | :--- |
| `doc_count` | Integer | The number of documents missing the specified field. |
File diff suppressed because it is too large Load Diff
+42 -73
View File
@@ -2,85 +2,28 @@
layout: default
title: Nested
parent: Bucket aggregations
grand_parent: Aggregations
nav_order: 140
redirect_from:
- /query-dsl/aggregations/bucket/nested/
---
# Nested aggregations
# Nested aggregation
The `nested` aggregation lets you aggregate on fields inside a nested object. The `nested` type is a specialized version of the object data type that allows arrays of objects to be indexed in a way that they can be queried independently of each other
The `nested` aggregation lets you aggregate on fields inside a [nested]({{site.url}}{{site.baseurl}}/field-types/supported-field-types/nested/) object. The `nested` type is a specialized version of the `object` data type that indexes each element of an array of objects as a separate, hidden document. This preserves the relationship between fields within the same array element so they can be queried and aggregated together.
With the `object` type, all the data is stored in the same document, so matches for a search can go across sub documents. For example, imagine a `logs` index with `pages` mapped as an `object` datatype:
## Nested aggregation example
To aggregate over fields inside a nested array, specify the `path` to the nested field and define subaggregations under it:
```json
PUT logs/_doc/0
{
"response": "200",
"pages": [
{
"page": "landing",
"load_time": 200
},
{
"page": "blog",
"load_time": 500
}
]
}
```
{% include copy-curl.html %}
OpenSearch merges all sub-properties of the entity relations that looks something like this:
```json
{
"logs": {
"pages": ["landing", "blog"],
"load_time": ["200", "500"]
}
}
```
So, if you wanted to search this index with `pages=landing` and `load_time=500`, this document matches the criteria even though the `load_time` value for landing is 200.
If you want to make sure such cross-object matches don’t happen, map the field as a `nested` type:
```json
PUT logs
{
"mappings": {
"properties": {
"pages": {
"type": "nested",
"properties": {
"page": { "type": "text" },
"load_time": { "type": "double" }
}
}
}
}
}
```
{% 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.
You have to specify a nested path relative to parent that contains the nested documents:
```json
GET logs/_search
GET logs-nested/_search
{
"query": {
"match": { "response": "200" }
},
"aggs": {
"pages": {
"nested": {
"path": "pages"
},
"nested": { "path": "pages" },
"aggs": {
"min_load_time": { "min": { "field": "pages.load_time" } }
}
@@ -90,17 +33,43 @@ GET logs/_search
```
{% include copy-curl.html %}
#### Example response
The returned hit contains the requested aggregation:
```json
...
"aggregations" : {
"pages" : {
"doc_count" : 2,
"min_price" : {
"value" : 200.0
"hits": {
"total": {
"value": 1,
"relation": "eq"
},
"max_score": 1,
"hits": [
{
"_index": "logs-nested",
"_id": "0",
"_score": 1,
"_source": {
"response": "200",
"pages": [
{
"page": "landing",
"load_time": 200
},
{
"page": "blog",
"load_time": 500
}
]
}
}
]
},
"aggregations": {
"pages": {
"doc_count": 2,
"min_load_time": {
"value": 200
}
}
}
}
}
```
+153
View File
@@ -0,0 +1,153 @@
---
layout: default
title: Parent
parent: Bucket aggregations
nav_order: 145
---
# Parent aggregation
The `parent` aggregation is a bucket aggregation that creates a single bucket containing parent documents, based on parent-child relationships defined in your index. This aggregation enables you to perform analytics on parent documents that have the same matching child documents, allowing for powerful hierarchical data analysis.
The `parent` aggregation works with the [`join` field type]({{site.url}}{{site.baseurl}}/mappings/supported-field-types/join/), which establishes parent-child relationships within documents in the same index.
The `parent` aggregation identifies parent documents that have matching child documents, whereas the [`children` aggregation]({{site.url}}{{site.baseurl}}/aggregations/bucket/children/) identifies child documents that match a certain child relation. Both aggregations take the child relation name as input.
## Parameters
The `parent` aggregation takes the following parameters:
| Parameter | Required/Optional | Data type | Description |
| :-- | :-- | :-- | :-- |
| `type` | Required | String | The name of the child type from the `join` field. |
## Example
The following example builds a small company database with three employees. The employee records each have a child `join` relationship with a parent department record.
First, create a `company` index with a `join` field that maps departments (parents) to employees (children):
```json
PUT /company
{
"mappings": {
"properties": {
"join_field": {
"type": "join",
"relations": {
"department": "employee"
}
},
"department_name": {
"type": "keyword"
},
"employee_name": {
"type": "keyword"
},
"salary": {
"type": "double"
},
"hire_date": {
"type": "date"
}
}
}
}
```
{% include copy-curl.html %}
Next, populate the data with three departments and three employees. The parent-child assignments are presented in the following table.
| Department (parent) | Employees (children) |
| :-- | :-- |
| `Accounting` | `Abel Anderson`, `Betty Billings` |
| `Engineering` | `Carl Carter` |
| `HR` | none |
The `routing` parameter ensures that both parent and child documents are stored on the same shard, which is required in order for parent-child relationships to function correctly in OpenSearch:
```json
POST _bulk?routing=1
{ "create": { "_index": "company", "_id": "1" } }
{ "type": "department", "department_name": "Accounting", "join_field": "department" }
{ "create": { "_index": "company", "_id": "2" } }
{ "type": "department", "department_name": "Engineering", "join_field": "department" }
{ "create": { "_index": "company", "_id": "3" } }
{ "type": "department", "department_name": "HR", "join_field": "department" }
{ "create": { "_index": "company", "_id": "4" } }
{ "type": "employee", "employee_name": "Abel Anderson", "salary": 120000, "hire_date": "2024-04-04", "join_field": { "name": "employee", "parent": "1" } }
{ "create": { "_index": "company", "_id": "5" } }
{ "type": "employee", "employee_name": "Betty Billings", "salary": 140000, "hire_date": "2023-05-05", "join_field": { "name": "employee", "parent": "1" } }
{ "create": { "_index": "company", "_id": "6" } }
{ "type": "employee", "employee_name": "Carl Carter", "salary": 140000, "hire_date": "2020-06-06", "join_field": { "name": "employee", "parent": "2" } }
```
{% include copy-curl.html %}
Lastly, run an aggregation of all the departments that have a parent relationship with one or more employees:
```json
GET /company/_search
{
"size": 0,
"aggs": {
"all_departments": {
"parent": {
"type": "employee"
},
"aggs": {
"departments": {
"terms": {
"field": "department_name"
}
}
}
}
}
}
```
{% include copy-curl.html %}
## Example response
The `all_departments` parent aggregation returns all the departments with employee child documents. Note that the HR department is not represented:
```json
{
"took": 3,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 6,
"relation": "eq"
},
"max_score": null,
"hits": []
},
"aggregations": {
"all_departments": {
"doc_count": 2,
"departments": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "Accounting",
"doc_count": 1
},
{
"key": "Engineering",
"doc_count": 1
}
]
}
}
}
}
```
+122 -45
View File
@@ -2,40 +2,111 @@
layout: default
title: Range
parent: Bucket aggregations
grand_parent: Aggregations
nav_order: 150
redirect_from:
- /query-dsl/aggregations/bucket/range/
---
# Range aggregations
# Range aggregation
The `range` aggregation lets you define the range for each bucket.
The `range` aggregation groups documents into buckets based on value ranges that you define. Each bucket captures documents whose field value falls within its specified `from` (inclusive) and `to` (exclusive) boundaries. Unlike the [`histogram` aggregation]({{site.url}}{{site.baseurl}}/aggregations/bucket/histogram/), which creates uniform intervals automatically, `range` lets you define arbitrary, non-uniform boundaries.
For example, you can find the number of bytes between 1000 and 2000, 2000 and 3000, and 3000 and 4000.
Within the `range` parameter, you can define ranges as objects of an array.
## Parameters
The `range` aggregation takes the following parameters.
| Parameter | Required/Optional | Data type | Description |
| :--- | :--- | :--- | :--- |
| `field` | Optional | String | The numeric field to aggregate on. Either `field` or `script` is required. |
| `script` | Optional | Object | A script that produces the value to aggregate on. Either `field` or `script` is required. When used with `field`, the script acts as a value script and receives the field value as `_value`. |
| `ranges` | Required | Array | A list of range boundaries. Each entry can include `from`, `to`, and optionally `key`. |
| `keyed` | Optional | Boolean | When `true`, returns buckets as an object keyed by range name instead of an array. Default is `false`. |
| `missing` | Optional | Number | The value to use for documents missing the target field. By default, missing documents are ignored. |
## Example: Custom-named price tiers with subaggregation
The following example segments e-commerce orders into three price tiers and computes the average order value within each tier:
```json
GET opensearch_dashboards_sample_data_logs/_search
GET /opensearch_dashboards_sample_data_ecommerce/_search
{
"size": 0,
"aggs": {
"number_of_bytes_distribution": {
"price_tiers": {
"range": {
"field": "bytes",
"field": "taxful_total_price",
"keyed": true,
"ranges": [
{
"from": 1000,
"to": 2000
},
{
"from": 2000,
"to": 3000
},
{
"from": 3000,
"to": 4000
{ "key": "budget", "to": 50 },
{ "key": "mid_range", "from": 50, "to": 100 },
{ "key": "premium", "from": 100 }
]
},
"aggs": {
"avg_price": {
"avg": { "field": "taxful_total_price" }
}
}
}
}
}
```
{% include copy-curl.html %}
The response groups orders into labeled tiers with their average prices:
```json
{
...
"aggregations": {
"price_tiers": {
"buckets": {
"budget": {
"to": 50.0,
"doc_count": 1633,
"avg_price": {
"value": 38.363175998928355
}
},
"mid_range": {
"from": 50.0,
"to": 100.0,
"doc_count": 2036,
"avg_price": {
"value": 72.34457883104126
}
},
"premium": {
"from": 100.0,
"doc_count": 1006,
"avg_price": {
"value": 140.10288270377734
}
}
}
}
}
}
```
## Example: Using a script
You can use a script instead of a field to compute values on the fly. The following example applies a 10% markup to prices before bucketing:
```json
GET /opensearch_dashboards_sample_data_ecommerce/_search
{
"size": 0,
"aggs": {
"marked_up_tiers": {
"range": {
"script": {
"source": "doc['taxful_total_price'].value * 1.1"
},
"ranges": [
{ "to": 55 },
{ "from": 55, "to": 110 },
{ "from": 110 }
]
}
}
@@ -44,35 +115,41 @@ GET opensearch_dashboards_sample_data_logs/_search
```
{% include copy-curl.html %}
The response includes the `from` key values and excludes the `to` key values:
## Example: Transforming field values with a value script
#### Example response
When you specify both `field` and `script`, the script receives each field value as the `_value` variable. The following example converts USD prices to euros (at a 0.92 rate) before evaluating which range they fall into:
```json
...
"aggregations" : {
"number_of_bytes_distribution" : {
"buckets" : [
{
"key" : "1000.0-2000.0",
"from" : 1000.0,
"to" : 2000.0,
"doc_count" : 805
},
{
"key" : "2000.0-3000.0",
"from" : 2000.0,
"to" : 3000.0,
"doc_count" : 1369
},
{
"key" : "3000.0-4000.0",
"from" : 3000.0,
"to" : 4000.0,
"doc_count" : 1422
GET /opensearch_dashboards_sample_data_ecommerce/_search
{
"size": 0,
"aggs": {
"price_in_euros": {
"range": {
"field": "taxful_total_price",
"script": {
"source": "_value * 0.92"
},
"ranges": [
{ "to": 46 },
{ "from": 46, "to": 92 },
{ "from": 92 }
]
}
]
}
}
}
}
```
```
{% include copy-curl.html %}
## Response body fields
The following table lists the response body fields.
| Field | Data type | Description |
| :--- | :--- | :--- |
| `buckets` | Array or Object | The range buckets. Returned as an array by default, or as an object when `keyed` is `true`. |
| `buckets.key` | String | The auto-generated range label (for example, `*-50.0` or `50.0-100.0`), or a custom key if specified. |
| `buckets.from` | Double | The lower bound of the range (inclusive). Omitted for open-ended ranges with no lower bound. |
| `buckets.to` | Double | The upper bound of the range (exclusive). Omitted for open-ended ranges with no upper bound. |
| `buckets.doc_count` | Integer | The number of documents falling within this range. |
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+124 -43
View File
@@ -2,48 +2,55 @@
layout: default
title: Sampler
parent: Bucket aggregations
grand_parent: Aggregations
nav_order: 170
redirect_from:
- /query-dsl/aggregations/bucket/sampler/
---
# Sampler aggregations
# Sampler aggregation
If you're aggregating a very large number of documents, you can use a `sampler` aggregation to reduce the scope to a small sample of documents, resulting in a faster response. The `sampler` aggregation selects the samples by top-scoring documents.
The `sampler` aggregation limits subaggregation processing to the top-scoring documents on each shard. This narrows the focus to the most relevant matches rather than processing the entire result set, which reduces computation time and can improve the quality of aggregation results by excluding low-relevance documents from the long tail.
The results are approximate but closely represent the distribution of the real data. The `sampler` aggregation significantly improves query performance, but the estimated responses are not entirely reliable.
Sampling is particularly valuable with subaggregations like `significant_terms`. Without a sampler, the full result set includes a long tail of marginally relevant documents whose generic terms dominate by volume, obscuring the truly distinctive terms found in top-scoring matches.
The basic syntax is:
For diversity-based sampling that prevents any single field value from dominating the sample, see the [`diversified_sampler` aggregation]({{site.url}}{{site.baseurl}}/aggregations/bucket/diversified-sampler/).
## Parameters
The `sampler` aggregation takes the following parameters.
| Parameter | Required/Optional | Data type | Description |
| :--- | :--- | :--- | :--- |
| `shard_size` | Optional | Integer | The maximum number of top-scoring documents collected from each shard. Default is `100`. |
The `sampler` aggregation can be nested under a `terms` aggregation. If the `terms` aggregation uses the `breadth_first` collect mode, OpenSearch replays the relevance scores of the deferred documents, so the sample is still based on the top-scoring documents.
{: .note}
## Example: Sampling the top-scoring documents
The following examples use a `shakespeare` index containing the complete works of Shakespeare, in which each document is one line of a play. The `text_entry` field contains the text of the line, and the `play_name` field is a `keyword` field.
A query for `king falstaff` matches 1,545 lines. Most of them contain only the common word `king`, but the lines that also contain the rarer word `falstaff` receive the highest scores. The following request samples the 100 top-scoring lines on each shard and runs a `significant_terms` subaggregation to find the plays that are most associated with the sample:
```json
“aggs”: {
"SAMPLE": {
"sampler": {
"shard_size": 100
},
"aggs": {...}
}
}
```
## Shard size property
The `shard_size` property tells OpenSearch how many documents (at most) to collect from each shard.
The following example limits the number of documents collected on each shard to 1,000 and then buckets the documents by a `terms` aggregation:
```json
GET opensearch_dashboards_sample_data_logs/_search
GET /shakespeare/_search
{
"size": 0,
"query": {
"match": {
"text_entry": "king falstaff"
}
},
"aggs": {
"sample": {
"sampler": {
"shard_size": 1000
"shard_size": 100
},
"aggs": {
"terms": {
"terms": {
"field": "agent.keyword"
"plays": {
"significant_terms": {
"field": "play_name",
"size": 3
}
}
}
@@ -53,32 +60,106 @@ GET opensearch_dashboards_sample_data_logs/_search
```
{% include copy-curl.html %}
#### Example response
The sample contains 100 lines, and the most significant plays are *The Merry Wives of Windsor* and *Henry IV*, the plays in which Falstaff appears:
```json
...
"aggregations" : {
"sample" : {
"doc_count" : 1000,
"terms" : {
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 0,
"buckets" : [
{
...
"aggregations": {
"sample": {
"doc_count": 100,
"plays": {
"doc_count": 100,
"bg_count": 111396,
"buckets": [
{
"key": "Merry Wives of Windsor",
"doc_count": 41,
"score": 6.2045063935005285,
"bg_count": 2831
},
{
"key": "Henry IV",
"doc_count": 31,
"score": 3.0301421528861154,
"bg_count": 3205
},
{
"key": "Hamlet",
"doc_count": 6,
"score": 0.03449236569274269,
"bg_count": 4244
}
]
}
}
}
}
```
## Example: Running the aggregation without a sampler
The following request runs the same `significant_terms` aggregation on all 1,545 matching lines, without a sampler:
```json
GET /shakespeare/_search
{
"size": 0,
"query": {
"match": {
"text_entry": "king falstaff"
}
},
"aggs": {
"plays": {
"significant_terms": {
"field": "play_name",
"size": 3
}
}
}
}
```
{% include copy-curl.html %}
Because the long tail of lines that contain only `king` outweighs the Falstaff lines, the most significant plays are the history plays about kings, such as *Henry VI, Part 3* and *Richard II*. The aggregation also processes all 1,545 matching documents instead of 100:
```json
{
...
"aggregations": {
"plays": {
"doc_count": 1545,
"bg_count": 111396,
"buckets": [
{
"key" : "Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110421 Firefox/6.0a1",
"doc_count" : 368
"key": "Henry VI Part 3",
"doc_count": 168,
"score": 0.31100010146873747,
"bg_count": 3138
},
{
"key" : "Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.50 Safari/534.24",
"doc_count" : 329
"key": "Richard II",
"doc_count": 143,
"score": 0.23236659237692917,
"bg_count": 2937
},
{
"key" : "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)",
"doc_count" : 303
"key": "Henry VI Part 2",
"doc_count": 125,
"score": 0.13780305490414782,
"bg_count": 3334
}
]
}
}
}
}
```
## Response body fields
The following table lists the response body fields.
| Field | Data type | Description |
| :--- | :--- | :--- |
| `doc_count` | Integer | The total number of documents in the sample across all shards. |
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More