Compare commits
201 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 78621f98e3 | |||
| df42f777f9 | |||
| 17ae32cb9a | |||
| 861644393d | |||
| b863e18503 | |||
| 5789bb4c28 | |||
| 3901ea23c1 | |||
| 00d2db4917 | |||
| 60da8fa182 | |||
| b9023ab6ec | |||
| 90e28e6f23 | |||
| d60acc5fd2 | |||
| 747c4d7730 | |||
| 10ec3ef95e | |||
| b695c750ad | |||
| f9baa125c3 | |||
| fd1ea4c9ac | |||
| 1dcdee97f8 | |||
| 2452e60305 | |||
| 7d070e1ac2 | |||
| 83a7bbffc0 | |||
| 8d548ca475 | |||
| c8761d3bd6 | |||
| b5812bebbf | |||
| d90d9859a2 | |||
| 294da5c0df | |||
| 6ebe39307e | |||
| b6f61a753c | |||
| d6b02c0e17 | |||
| f7093ffd8f | |||
| 0a497238c7 | |||
| 0c9fe0271a | |||
| d1a065587c | |||
| 2561bc262f | |||
| be92ce0783 | |||
| 95b5157c19 | |||
| 1d99315e8b | |||
| 6f32dce469 | |||
| fac01d293e | |||
| 634db90e9b | |||
| 42095bd2d7 | |||
| 0d58bcf854 | |||
| a75fbf62dc | |||
| 5b1f7fdaca | |||
| dbb3d893ac | |||
| 187bccec6b | |||
| 3f7f651619 | |||
| bd944e8448 | |||
| fa7943b905 | |||
| 47a1573202 | |||
| 45fea0e20e | |||
| 4a4c43482a | |||
| bdf53c9117 | |||
| ee1400ff2b | |||
| eb51f06694 | |||
| 1f60c9c307 | |||
| bf78a468c3 | |||
| 8c703b9cff | |||
| a3808e858a | |||
| 59f7ffeb99 | |||
| eac60ec797 | |||
| b8b7fb13e3 | |||
| b4461e130f | |||
| ba5bfa429f | |||
| 266df8e006 | |||
| 2ff209d0b8 | |||
| 28e0409da3 | |||
| 7c33c8d5a4 | |||
| f315193267 | |||
| 84e9440f18 | |||
| 96a70a820a | |||
| 3d509b3976 | |||
| dc2f349d7e | |||
| db86114248 | |||
| 30df98e078 | |||
| 0ac341523a | |||
| 15f9c6bc5c | |||
| a9bde64480 | |||
| a4cca7c71b | |||
| 4705da9726 | |||
| 5f678cd814 | |||
| 01df7f0b53 | |||
| d06c1bc978 | |||
| e378928a5d | |||
| 31bf69767a | |||
| a77c678c98 | |||
| 76e3b2710e | |||
| 793ce77490 | |||
| 2b31c5392c | |||
| 37cab900a5 | |||
| 6c9a46c130 | |||
| 15a5f18fb7 | |||
| 4453173942 | |||
| 23981ecc33 | |||
| a99458c41b | |||
| b93af9a94b | |||
| 25421e60e0 | |||
| c961ca45d0 | |||
| fb9ecbbc15 | |||
| 63f391a3ef | |||
| 537eaa7743 | |||
| c098a80fdb | |||
| 9574bd2c30 | |||
| 951a2e01f1 | |||
| 546ce5293b | |||
| 9e4618111c | |||
| 40f2e462c1 | |||
| 0257a9de5d | |||
| cff7b8fea3 | |||
| 9ae5a6bfc8 | |||
| 3bbdae031e | |||
| 540595fcea | |||
| 13eb8e50ff | |||
| c6aaa74993 | |||
| 96f2dbafdf | |||
| 45c8214c2b | |||
| 4841a9985c | |||
| 49a765d0a5 | |||
| 67423ff9c2 | |||
| 5a4d4dabba | |||
| 05d6b6cb5d | |||
| 6e9249e58c | |||
| 432005eaa0 | |||
| 3d3bc88422 | |||
| 75a835f29b | |||
| d00637b05e | |||
| 73667cafd0 | |||
| be8d244d8c | |||
| 1e031e8362 | |||
| 59969664a5 | |||
| 3c27d762ef | |||
| 47bd70cb2b | |||
| b8bf7a2f1d | |||
| 6c6c9c619f | |||
| a335f8741a | |||
| c0871cfe0d | |||
| 92b3b49ee2 | |||
| cf769012ca | |||
| 4a2e1c32db | |||
| 79b647ee62 | |||
| e5bec0b980 | |||
| d3d9774eaf | |||
| e484b3e93f | |||
| d7ce813388 | |||
| 18e74399fa | |||
| 81bf0b2655 | |||
| 21b4c3ab87 | |||
| 24acbc3d56 | |||
| d6770ec66e | |||
| 62491a2a98 | |||
| faa347c20f | |||
| 31ebf2634d | |||
| b81261034b | |||
| 610c958b2d | |||
| 5d5dc6c413 | |||
| b79ee7cf34 | |||
| 7488bc3d83 | |||
| 87d14aedf0 | |||
| 7424f51f82 | |||
| c769eea533 | |||
| 8f635fe5cd | |||
| 4693e3ba27 | |||
| 8fbdb4ba11 | |||
| 4d3db0bbd4 | |||
| 6569051dc8 | |||
| e4219fe761 | |||
| 268a85ba0c | |||
| 1835b3ec37 | |||
| 29feadfb57 | |||
| 041fd93005 | |||
| 676314ceaf | |||
| 4edfffe18c | |||
| 475f1227ff | |||
| 13f7a847c1 | |||
| 40c6f07871 | |||
| 82fce438bc | |||
| 0094f38d4d | |||
| 4cd5ceb312 | |||
| e347a869bc | |||
| a179929bdb | |||
| 119b9e79ec | |||
| 4ca66d11c3 | |||
| f47b41b984 | |||
| c0ddecacd8 | |||
| 07a22dff69 | |||
| de06d8b143 | |||
| d997df6164 | |||
| 93409f1333 | |||
| e7cc6db397 | |||
| 85d9de759c | |||
| df471fb310 | |||
| c38f9f9905 | |||
| cfd782d857 | |||
| 8702fa875b | |||
| 70837a3f9e | |||
| 8ee083b6d2 | |||
| d3a26b8353 | |||
| 4e469c2579 | |||
| dd964c3b78 | |||
| 59e7b8d64a | |||
| c8049ae44c |
@@ -4,3 +4,4 @@ _site
|
||||
.DS_Store
|
||||
Gemfile.lock
|
||||
.idea
|
||||
.jekyll-cache
|
||||
|
||||
@@ -8,22 +8,22 @@ source "https://rubygems.org"
|
||||
#
|
||||
# This will help ensure the proper Jekyll version is running.
|
||||
# Happy Jekylling!
|
||||
# gem "jekyll", "~> 3.9.0"
|
||||
gem "jekyll", "~> 4.2.0"
|
||||
|
||||
# This is the default theme for new Jekyll sites. You may change this to anything you like.
|
||||
gem "just-the-docs", "~> 0.3.3"
|
||||
gem "jekyll-remote-theme", "~> 0.4"
|
||||
gem "jekyll-redirect-from", "~> 0.16"
|
||||
|
||||
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
|
||||
# uncomment the line below. To upgrade, run `bundle update github-pages`.
|
||||
|
||||
gem 'github-pages', group: :jekyll_plugins
|
||||
# gem 'github-pages', group: :jekyll_plugins
|
||||
|
||||
# If you have any plugins, put them here!
|
||||
# group :jekyll_plugins do
|
||||
# # gem "jekyll-feed", "~> 0.6"
|
||||
# gem "jekyll-remote-theme"
|
||||
# gem "jekyll-redirect-from"
|
||||
# end
|
||||
group :jekyll_plugins do
|
||||
gem "jekyll-sitemap"
|
||||
end
|
||||
|
||||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
||||
|
||||
@@ -1 +1 @@
|
||||
Copyright 2021 OpenSearch contributors.
|
||||
Copyright OpenSearch contributors.
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<img src="https://opensearch.org/assets/img/opensearch-logo-themed.svg" height="64px">
|
||||
|
||||
# OpenSearch documentation
|
||||
|
||||
This repository contains the documentation for OpenSearch, the search, analytics, and visualization suite with advanced security, alerting, SQL support, automated index management, deep performance analysis, and more. You can find the rendered documentation at [docs-beta.opensearch.org](https://docs-beta.opensearch.org).
|
||||
This repository contains the documentation for OpenSearch, the search, analytics, and visualization suite with advanced security, alerting, SQL support, automated index management, deep performance analysis, and more. You can find the rendered documentation at [opensearch.org/docs](https://opensearch.org/docs).
|
||||
|
||||
Community contributions remain essential in keeping this documentation comprehensive, useful, well-organized, and up-to-date.
|
||||
|
||||
@@ -11,9 +13,9 @@ Community contributions remain essential in keeping this documentation comprehen
|
||||
|
||||
Often, engineering teams can keep existing documentation up-to-date with minimal effort, thus freeing up the documentation team to focus on larger projects.
|
||||
|
||||
- Do you have expertise in a particular area of OpenSearch? Cluster sizing? The query DSL? Painless scripting? Aggregations? JVM settings? Take a look at the [current content](https://docs-beta.opensearch.org/docs/opensearch/) and see where you can add value. The [documentation team](#points-of-contact) is happy to help you polish and organize your drafts.
|
||||
- Do you have expertise in a particular area of OpenSearch? Cluster sizing? The query DSL? Painless scripting? Aggregations? JVM settings? Take a look at the [current content](https://opensearch.org/docs/opensearch/) and see where you can add value. The [documentation team](#points-of-contact) is happy to help you polish and organize your drafts.
|
||||
|
||||
- Are you an OpenSearch Dashboards expert? How did you set up your visualizations? Why is a particular dashboard so valuable to your organization? We have [very little](https://docs-beta.opensearch.org/docs/opensearch-dashboards/) on how to use OpenSearch Dashboards, only how to install it.
|
||||
- Are you an OpenSearch Dashboards expert? How did you set up your visualizations? Why is a particular dashboard so valuable to your organization? We have [very little](https://opensearch.org/docs/opensearch-dashboards/) on how to use OpenSearch Dashboards, only how to install it.
|
||||
|
||||
- Are you a web developer? Do you want to add an optional dark mode to the documentation? A "copy to clipboard" button for our code samples? Other improvements to the design or usability? See [major changes](#major-changes) for information on building the website locally.
|
||||
|
||||
@@ -30,11 +32,9 @@ If you encounter problems or have questions when contributing to the documentati
|
||||
- [snyder114](https://github.com/snyder114)
|
||||
|
||||
|
||||
## How we build the website
|
||||
## How the website works
|
||||
|
||||
After each commit to this repository, GitHub Pages automatically uses [Jekyll](https://jekyllrb.com) to rebuild the [website](https://docs-beta.opensearch.org). The whole process takes around 30 seconds.
|
||||
|
||||
This repository contains many [Markdown](https://guides.github.com/features/mastering-markdown/) files in the `/docs` directory. Each Markdown file correlates with one page on the website. For example, the Markdown file for [this page](https://docs-beta.opensearch.org/docs/opensearch/) is [here](https://github.com/opensearch-project/documentation-website/blob/master/docs/opensearch/index.md).
|
||||
This repository contains many [Markdown](https://guides.github.com/features/mastering-markdown/) files organized into Jekyll "collections" (e.g. `_search-plugins`, `_opensearch`, etc.). Each Markdown file correlates with one page on the website.
|
||||
|
||||
Using plain text on GitHub has many advantages:
|
||||
|
||||
@@ -133,15 +133,15 @@ If you're making major changes to the documentation and need to see the rendered
|
||||
sh build.sh
|
||||
```
|
||||
|
||||
1. If the build script doesn't automatically open your web browser (it should), open [http://localhost:4000/](http://localhost:4000/).
|
||||
1. If the build script doesn't automatically open your web browser (it should), open [http://localhost:4000/docs/](http://localhost:4000/docs/).
|
||||
|
||||
1. Create a new branch.
|
||||
|
||||
1. Edit the Markdown files in `/docs`.
|
||||
1. Edit the Markdown files in each collection (e.g. `_security-plugin/`).
|
||||
|
||||
If you're a web developer, you can customize `_layouts/default.html` and `_sass/custom/custom.scss`.
|
||||
|
||||
1. When you save a file, marvel as Jekyll automatically rebuilds the site and refreshes your web browser. This process takes roughly 30 seconds.
|
||||
1. When you save a file, marvel as Jekyll automatically rebuilds the site and refreshes your web browser. This process can take anywhere from 10-30 seconds.
|
||||
|
||||
1. When you're happy with how everything looks, commit, push your changes to your fork, and submit a pull request.
|
||||
|
||||
@@ -225,7 +225,7 @@ This documentation uses a modified version of the [just-the-docs](https://github
|
||||
|
||||
## Get started
|
||||
New
|
||||
{: .label .label-green :}
|
||||
{: .label .label-green }
|
||||
```
|
||||
|
||||
* Labels come in default (blue), green, purple, yellow, and red.
|
||||
@@ -238,6 +238,27 @@ These classes can help with readability, but should be used *sparingly*. Each ad
|
||||
Besides, standard Markdown elements suffice for most documentation.
|
||||
|
||||
|
||||
## Labels for APIs
|
||||
|
||||
Each API operation has a label indicating when it was introduced. For most operations, this label is 1.0:
|
||||
|
||||
```
|
||||
## Get roles
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
```
|
||||
|
||||
If we introduce a breaking change to an operation, add an additional label with a link to the release note for that breaking change:
|
||||
|
||||
```
|
||||
## Get roles
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
[Last breaking change 2.0](https://example.com)
|
||||
{: .label .label-red }
|
||||
```
|
||||
|
||||
|
||||
## Math
|
||||
|
||||
If you want to use the sorts of pretty formulas that [MathJax](https://www.mathjax.org) allows, add `has_math: true` to the Jekyll page metadata. Then insert LaTeX math into HTML tags with the rest of your Markdown content:
|
||||
@@ -273,4 +294,4 @@ This project is licensed under the Apache-2.0 License.
|
||||
|
||||
## Copyright
|
||||
|
||||
Copyright 2021 OpenSearch contributors.
|
||||
Copyright OpenSearch contributors.
|
||||
|
||||
@@ -4,15 +4,45 @@ title: Agents and ingestion tools
|
||||
nav_order: 100
|
||||
has_children: false
|
||||
has_toc: false
|
||||
redirect_from:
|
||||
- /clients/agents-and-ingestion-tools/
|
||||
---
|
||||
|
||||
# Agents and ingestion tools
|
||||
|
||||
Historically, many multiple popular agents and ingestion tools have worked with Elasticsearch OSS, such as Beats, Logstash, Fluentd, FluentBit, and OpenTelemetry. OpenSearch aims to continue to support a broad set of agents and ingestion tools, but not all have been tested or have explicitly added OpenSearch compatibility.
|
||||
|
||||
As an intermediate solution, we are adding a [version value](https://github.com/opensearch-project/OpenSearch/issues/693) to `opensearch.yml`. This change will let you set OpenSearch 1.x clusters to report version 7.10.2 (or any other arbitrary value). By reporting 7.10.2, the cluster will be able to connect with tools that check for a particular version number.
|
||||
As an intermediate compatibility solution, OpenSearch has a setting that instructs the cluster to return version 7.10.2 rather than its actual version.
|
||||
|
||||
For a longer term solution, we plan to create an OpenSearch output plugin for Logstash. This plugin *does not exist yet*, but we've included it in the compatibility matrices below based on its expected behavior.
|
||||
If you use clients that include a version check, such as recent versions of Logstash OSS or Filebeat OSS, enable the setting:
|
||||
|
||||
```json
|
||||
PUT _cluster/settings
|
||||
{
|
||||
"persistent": {
|
||||
"compatibility": {
|
||||
"override_main_response_version": true
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Downloads
|
||||
|
||||
You can download the OpenSearch output plugin for Logstash from [OpenSearch downloads](https://opensearch.org/downloads.html). The Logstash output plugin is compatible with OpenSearch and Elasticsearch OSS (7.10.2 or lower).
|
||||
|
||||
These versions of Beats offer the best compatibility with OpenSearch. For more information, see the [compatibility matrices](#compatibility-matrices).
|
||||
|
||||
- [Filebeat OSS 7.12.1](https://www.elastic.co/downloads/past-releases/filebeat-oss-7-12-1)
|
||||
- [Metricbeat OSS 7.12.1](https://www.elastic.co/downloads/past-releases/metricbeat-oss-7-12-1)
|
||||
- [Packetbeat OSS 7.12.1](https://www.elastic.co/downloads/past-releases/packetbeat-oss-7-12-1)
|
||||
- [Heartbeat OSS 7.12.1](https://elastic.co/downloads/past-releases/heartbeat-oss-7-12-1)
|
||||
- [Winlogbeat OSS 7.12.1](https://www.elastic.co/downloads/past-releases/winlogbeat-oss-7-12-1)
|
||||
- [Auditbeat OSS 7.12.1](https://elastic.co/downloads/past-releases/auditbeat-oss-7-12-1)
|
||||
|
||||
Some users report compatibility issues with ingest pipelines on these versions of Beats. If you use ingest pipelines with OpenSearch, consider using the 7.10.2 versions of Beats OSS instead.
|
||||
{: .note }
|
||||
|
||||
|
||||
## Compatibility Matrices
|
||||
@@ -22,28 +52,26 @@ For a longer term solution, we plan to create an OpenSearch output plugin for Lo
|
||||
|
||||
### Compatibility Matrix for Logstash
|
||||
|
||||
| | Logstash OSS 7.x to 7.11.x | Logstash OSS 7.12.x\* | Logstash 7.13.x without OpenSearch output plugin | Logstash 7.13.x with OpenSearch output plugin\*\* |
|
||||
| | Logstash OSS 7.x to 7.11.x | Logstash OSS 7.12.x\* | Logstash 7.13.x without OpenSearch output plugin | Logstash 7.13.x with OpenSearch output plugin |
|
||||
| :---| :--- | :--- | :--- | :--- |
|
||||
| Elasticsearch OSS v7.x to v7.9.x | *Yes* | *Yes* | *No* | *Yes* |
|
||||
| Elasticsearch OSS v7.10.2 | *Yes* | *Yes* | *No* | *Yes* |
|
||||
| ODFE OSS v1.x to 1.12 | *Yes* | *Yes* | *No* | *Yes* |
|
||||
| Elasticsearch OSS 7.x to 7.9.x | *Yes* | *Yes* | *No* | *Yes* |
|
||||
| Elasticsearch OSS 7.10.2 | *Yes* | *Yes* | *No* | *Yes* |
|
||||
| ODFE 1.x to 1.12 | *Yes* | *Yes* | *No* | *Yes* |
|
||||
| ODFE 1.13 | *Yes* | *Yes* | *No* | *Yes* |
|
||||
| OpenSearch 1.0 | [Yes via version setting](https://github.com/opensearch-project/OpenSearch/issues/693) | [Yes via version setting](https://github.com/opensearch-project/OpenSearch/issues/693) | *No* | *Yes* |
|
||||
| OpenSearch 1.0 | Yes via version setting | Yes via version setting | *No* | *Yes* |
|
||||
|
||||
\* Most current compatible version with Elasticsearch OSS.
|
||||
|
||||
\*\* Planning to build.
|
||||
|
||||
|
||||
### Compatibility Matrix for Beats
|
||||
|
||||
| | Beats OSS 7.x to 7.11.x\*\* | Beats OSS 7.12.x\* | Beats 7.13.x |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| Elasticsearch OSS v7.x to v7.9.x | *Yes* | *Yes* | No |
|
||||
| Elasticsearch OSS v7.10.2 | *Yes* | *Yes* | No |
|
||||
| ODFE OSS v1.x to 1.12 | *Yes* | *Yes* | No |
|
||||
| Elasticsearch OSS 7.x to 7.9.x | *Yes* | *Yes* | No |
|
||||
| Elasticsearch OSS 7.10.2 | *Yes* | *Yes* | No |
|
||||
| ODFE 1.x to 1.12 | *Yes* | *Yes* | No |
|
||||
| ODFE 1.13 | *Yes* | *Yes* | No |
|
||||
| OpenSearch 1.0 | [Yes via version setting](https://github.com/opensearch-project/OpenSearch/issues/693) | [Yes via version setting](https://github.com/opensearch-project/OpenSearch/issues/693) | No |
|
||||
| OpenSearch 1.0 | Yes via version setting | Yes via version setting | No |
|
||||
| Logstash OSS 7.x to 7.11.x | *Yes* | *Yes* | *Yes* |
|
||||
| Logstash OSS 7.12.x\* | *Yes* | *Yes* | *Yes* |
|
||||
| Logstash 7.13.x with OpenSearch output plugin | *Yes* | *Yes* | *Yes* |
|
||||
|
||||
@@ -3,9 +3,6 @@ layout: default
|
||||
title: OpenSearch CLI
|
||||
nav_order: 52
|
||||
has_children: false
|
||||
redirect_from:
|
||||
- /docs/odfe-cli/
|
||||
- /docs/cli/
|
||||
---
|
||||
|
||||
# OpenSearch CLI
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
---
|
||||
layout: default
|
||||
title: Compatibility
|
||||
nav_order: 1
|
||||
has_children: false
|
||||
redirect_from:
|
||||
- /clients/
|
||||
---
|
||||
|
||||
# OpenSearch client compatibility
|
||||
|
||||
Most clients that work with Elasticsearch OSS 7.10.2 *should* work with OpenSearch, but the latest versions of those clients might include license or version checks that artificially break compatibility. This page includes recommendations around which versions of those clients to use for best compatibility with OpenSearch.
|
||||
|
||||
Client | Recommended version
|
||||
:--- | :---
|
||||
[Java low-level REST client](https://search.maven.org/artifact/org.elasticsearch.client/elasticsearch-rest-client/7.13.4/jar) | 7.13.4
|
||||
[Java high-level REST client](https://search.maven.org/artifact/org.elasticsearch.client/elasticsearch-rest-high-level-client/7.13.4/jar) | 7.13.4
|
||||
[Python Elasticsearch client](https://pypi.org/project/elasticsearch/7.13.4/) | 7.13.4
|
||||
[Elasticsearch Node.js client](https://www.npmjs.com/package/@elastic/elasticsearch/v/7.13.0) | 7.13.0
|
||||
|
||||
Clients exist for a wide variety of languages, so if you test a client and verify that it works, please [submit a PR](https://github.com/opensearch-project/documentation-website/pulls) and add it to this table.
|
||||
|
||||
|
||||
{% comment %}
|
||||
## Python 3 test code
|
||||
|
||||
This code indexes a single document and is equivalent to `PUT /python-test-index1/_doc/1`.
|
||||
|
||||
```python
|
||||
from elasticsearch import Elasticsearch
|
||||
|
||||
host = 'localhost'
|
||||
port = 9200
|
||||
# For testing only. Do not store credentials in code.
|
||||
auth = ('admin', 'admin')
|
||||
|
||||
es = Elasticsearch(
|
||||
hosts = [{'host': host, 'port': port}],
|
||||
http_auth = auth,
|
||||
use_ssl = True,
|
||||
verify_certs = False
|
||||
)
|
||||
|
||||
document = {
|
||||
"title": "Moneyball",
|
||||
"director": "Bennett Miller",
|
||||
"year": "2011"
|
||||
}
|
||||
|
||||
response = es.index(index='python-test-index1', id='1', body=document, refresh=True)
|
||||
|
||||
print(response)
|
||||
```
|
||||
|
||||
|
||||
## Node.js test code
|
||||
|
||||
This code is equivalent to `GET /`.
|
||||
|
||||
```js
|
||||
const { Client } = require('@elastic/elasticsearch')
|
||||
const client = new Client({
|
||||
node: 'https://localhost:9200',
|
||||
auth: {
|
||||
// For testing only. Don't store credentials in code.
|
||||
username: 'admin',
|
||||
password: 'admin'
|
||||
},
|
||||
ssl: {
|
||||
// ca: fs.readFileSync('./cacert.pem'),
|
||||
rejectUnauthorized: false
|
||||
}
|
||||
})
|
||||
|
||||
async function run () {
|
||||
const { body } = await client.info();
|
||||
console.log(body);
|
||||
}
|
||||
|
||||
run().catch(console.log)
|
||||
```
|
||||
{% endcomment %}
|
||||
@@ -0,0 +1,124 @@
|
||||
---
|
||||
layout: default
|
||||
title: Java high-level REST client
|
||||
nav_order: 97
|
||||
---
|
||||
|
||||
# Java high-level REST client
|
||||
|
||||
The Elasticsearch OSS Java high-level REST client allows you to interact with your OpenSearch clusters and indices through Java methods and data structures rather than HTTP methods and JSON.
|
||||
|
||||
You submit requests to your cluster using request objects, which allows you to create indices, add data to documents, or complete other operations with your cluster. In return, you get back response objects that have all of the available information, such as the associated index or ID, from your cluster.
|
||||
|
||||
## Setup
|
||||
|
||||
To start using the Elasticsearch OSS Java high-level REST client, ensure that you have the following dependency in your project's `pom.xml` file:
|
||||
|
||||
```
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch.client</groupId>
|
||||
<artifactId>elasticsearch-rest-high-level-client</artifactId>
|
||||
<version>7.10.2</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
You can now start your OpenSearch cluster. The 7.10.2 high-level REST client works with the 1.x versions of OpenSearch.
|
||||
|
||||
## Sample code
|
||||
|
||||
```java
|
||||
import org.apache.http.HttpHost;
|
||||
import org.apache.http.auth.AuthScope;
|
||||
import org.apache.http.auth.UsernamePasswordCredentials;
|
||||
import org.apache.http.client.CredentialsProvider;
|
||||
import org.apache.http.impl.client.BasicCredentialsProvider;
|
||||
import org.apache.http.impl.nio.client.HttpAsyncClientBuilder;
|
||||
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
|
||||
import org.elasticsearch.action.delete.DeleteRequest;
|
||||
import org.elasticsearch.action.delete.DeleteResponse;
|
||||
import org.elasticsearch.action.get.GetRequest;
|
||||
import org.elasticsearch.action.get.GetResponse;
|
||||
import org.elasticsearch.action.index.IndexRequest;
|
||||
import org.elasticsearch.action.index.IndexResponse;
|
||||
import org.elasticsearch.action.support.master.AcknowledgedResponse;
|
||||
import org.elasticsearch.client.RequestOptions;
|
||||
import org.elasticsearch.client.RestClient;
|
||||
import org.elasticsearch.client.RestClientBuilder;
|
||||
import org.elasticsearch.client.RestHighLevelClient;
|
||||
import org.elasticsearch.client.indices.CreateIndexRequest;
|
||||
import org.elasticsearch.client.indices.CreateIndexResponse;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentType;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class RESTClientSample {
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
|
||||
//Point to keystore with appropriate certificates for security.
|
||||
System.setProperty("javax.net.ssl.trustStore", "/full/path/to/keystore");
|
||||
System.setProperty("javax.net.ssl.trustStorePassword", password-to-keystore);
|
||||
|
||||
//Establish credentials to use basic authentication.
|
||||
//Only for demo purposes. Do not specify your credentials in code.
|
||||
final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
|
||||
|
||||
credentialsProvider.setCredentials(AuthScope.ANY,
|
||||
new UsernamePasswordCredentials("admin", "admin"));
|
||||
|
||||
//Create a client.
|
||||
RestClientBuilder builder = RestClient.builder(new HttpHost("localhost", 9200, "https"))
|
||||
.setHttpClientConfigCallback(new RestClientBuilder.HttpClientConfigCallback() {
|
||||
@Override
|
||||
public HttpAsyncClientBuilder customizeHttpClient(HttpAsyncClientBuilder httpClientBuilder) {
|
||||
return httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
|
||||
}
|
||||
});
|
||||
RestHighLevelClient client = new RestHighLevelClient(builder);
|
||||
|
||||
//Create a non-default index with custom settings and mappings.
|
||||
CreateIndexRequest createIndexRequest = new CreateIndexRequest("custom-index");
|
||||
|
||||
createIndexRequest.settings(Settings.builder() //Specify in the settings how many shards you want in the index.
|
||||
.put("index.number_of_shards", 4)
|
||||
.put("index.number_of_replicas", 3)
|
||||
);
|
||||
//Create a set of maps for the index's mappings.
|
||||
HashMap<String, String> typeMapping = new HashMap<String,String>();
|
||||
typeMapping.put("type", "integer");
|
||||
HashMap<String, Object> ageMapping = new HashMap<String, Object>();
|
||||
ageMapping.put("age", typeMapping);
|
||||
HashMap<String, Object> mapping = new HashMap<String, Object>();
|
||||
mapping.put("properties", ageMapping);
|
||||
createIndexRequest.mapping(mapping);
|
||||
CreateIndexResponse createIndexResponse = client.indices().create(createIndexRequest, RequestOptions.DEFAULT
|
||||
|
||||
//Adding data to the index.
|
||||
IndexRequest request = new IndexRequest("custom-index"); //Add a document to the custom-index we created.
|
||||
request.id("1"); //Assign an ID to the document.
|
||||
|
||||
HashMap<String, String> stringMapping = new HashMap<String, String>();
|
||||
stringMapping.put("message:", "Testing Java REST client");
|
||||
request.source(stringMapping); //Place your content into the index's source.
|
||||
IndexResponse indexResponse = client.index(request, RequestOptions.DEFAULT);
|
||||
|
||||
//Getting back the document
|
||||
GetRequest getRequest = new GetRequest("custom-index", "1");
|
||||
GetResponse response = client.get(getRequest, RequestOptions.DEFAULT);
|
||||
|
||||
System.out.println(response.getSourceAsString());
|
||||
|
||||
//Delete the document
|
||||
DeleteRequest deleteDocumentRequest = new DeleteRequest("custom-index", "1"); //Index name followed by the ID.
|
||||
DeleteResponse deleteResponse = client.delete(deleteDocumentRequest, RequestOptions.DEFAULT);
|
||||
|
||||
//Delete the index
|
||||
DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest("custom-index"); //Index name.
|
||||
AcknowledgedResponse deleteIndexResponse = client.indices().delete(deleteIndexRequest, RequestOptions.DEFAULT);
|
||||
|
||||
client.close();
|
||||
}
|
||||
}
|
||||
```
|
||||
+23
-21
@@ -4,6 +4,8 @@ title: Logstash
|
||||
nav_order: 200
|
||||
has_children: true
|
||||
has_toc: true
|
||||
redirect_from:
|
||||
- /clients/logstash/
|
||||
---
|
||||
|
||||
# Logstash
|
||||
@@ -72,36 +74,36 @@ Make sure you have [Java Development Kit (JDK)](https://www.oracle.com/java/tech
|
||||
|
||||
1. Pull the Logstash oss package with the OpenSearch output plugin image:
|
||||
|
||||
```
|
||||
docker pull opensearchproject/logstash-oss-with-opensearch-output-plugin:7.13.2
|
||||
```
|
||||
```
|
||||
docker pull opensearchproject/logstash-oss-with-opensearch-output-plugin:7.13.2
|
||||
```
|
||||
|
||||
1. Create a Docker network:
|
||||
|
||||
```
|
||||
docker network create test
|
||||
```
|
||||
```
|
||||
docker network create test
|
||||
```
|
||||
|
||||
1. Start OpenSearch with this network:
|
||||
|
||||
```
|
||||
docker run -p 9200:9200 -p 9600:9600 --name opensearch --net test -e "discovery.type=single-node" opensearchproject/opensearch:1.0.0
|
||||
```
|
||||
```
|
||||
docker run -p 9200:9200 -p 9600:9600 --name opensearch --net test -e "discovery.type=single-node" opensearchproject/opensearch:1.0.0
|
||||
```
|
||||
|
||||
1. Start Logstash:
|
||||
|
||||
```
|
||||
docker run -it --rm --name logstash --net test openserachproject/logstash-oss-with-opensearch-output-plugin:7.13.2 -e 'input { stdin { } } output {
|
||||
opensearch {
|
||||
hosts => ["https://opensearch:9200"]
|
||||
index => "opensearch-logstash-docker-%{+YYYY.MM.dd}"
|
||||
user => "admin"
|
||||
password => "admin"
|
||||
ssl => true
|
||||
ssl_certificate_verification => false
|
||||
}
|
||||
}'
|
||||
```
|
||||
```
|
||||
docker run -it --rm --name logstash --net test opensearchproject/logstash-oss-with-opensearch-output-plugin:7.13.2 -e 'input { stdin { } } output {
|
||||
opensearch {
|
||||
hosts => ["https://opensearch:9200"]
|
||||
index => "opensearch-logstash-docker-%{+YYYY.MM.dd}"
|
||||
user => "admin"
|
||||
password => "admin"
|
||||
ssl => true
|
||||
ssl_certificate_verification => false
|
||||
}
|
||||
}'
|
||||
```
|
||||
|
||||
## Process text from the terminal
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ nav_order: 220
|
||||
|
||||
You can Ship Logstash events to an OpenSearch cluster and then visualize your events with OpenSearch Dashboards.
|
||||
|
||||
Make sure you have [Logstash]({{site.url}}{{site.baseurl}}/logstash/index/#install-logstash-on-mac--linux), [OpenSearch]({{site.url}}{{site.baseurl}}/opensearch/install/index/), and [OpenSearch Dashboards]({{site.url}}{{site.baseurl}}/dashboards/install/index/).
|
||||
Make sure you have [Logstash]({{site.url}}{{site.baseurl}}/clients/logstash/index/#install-logstash), [OpenSearch]({{site.url}}{{site.baseurl}}/opensearch/install/index/), and [OpenSearch Dashboards]({{site.url}}{{site.baseurl}}/dashboards/install/index/).
|
||||
{: .note }
|
||||
|
||||
## OpenSearch output plugin
|
||||
|
||||
+8
-8
@@ -1,11 +1,11 @@
|
||||
title: OpenSearch documentation
|
||||
description: >- # this means to ignore newlines until "baseurl:"
|
||||
Documentation for OpenSearch, the Apache 2.0 search, analytics, and visualization suite with advanced security, alerting, SQL support, automated index management, deep performance analysis, and more.
|
||||
baseurl: "" # the subpath of your site, e.g. /blog
|
||||
url: "https://docs-beta.opensearch.org" # the base hostname & protocol for your site, e.g. http://example.com
|
||||
baseurl: "/docs" # the subpath of your site, e.g. /blog
|
||||
url: "https://opensearch.org" # the base hostname & protocol for your site, e.g. http://example.com
|
||||
permalink: /:path/
|
||||
|
||||
opensearch_version: 1.0.0-rc1
|
||||
opensearch_version: 1.0.0
|
||||
opensearch_major_minor_version: 1.0
|
||||
|
||||
# Build settings
|
||||
@@ -20,14 +20,13 @@ logo: "/assets/images/logo.svg"
|
||||
|
||||
# Aux links for the upper right navigation
|
||||
aux_links:
|
||||
"Back to OpenSearch.org":
|
||||
- "https://opensearch.org"
|
||||
|
||||
color_scheme: opensearch
|
||||
|
||||
# Define Jekyll collections
|
||||
collections:
|
||||
# Define a collection named "tests", its documents reside in the "_tests" directory
|
||||
migrate:
|
||||
upgrade-to:
|
||||
permalink: /:collection/:path/
|
||||
output: true
|
||||
opensearch:
|
||||
@@ -61,8 +60,8 @@ collections:
|
||||
just_the_docs:
|
||||
# Define the collections used in the theme
|
||||
collections:
|
||||
migrate:
|
||||
name: Migrate to OpenSearch
|
||||
upgrade-to:
|
||||
name: Upgrade to OpenSearch
|
||||
# nav_exclude: true
|
||||
nav_fold: true
|
||||
# search_exclude: true
|
||||
@@ -138,6 +137,7 @@ footer_content:
|
||||
plugins:
|
||||
- jekyll-remote-theme
|
||||
- jekyll-redirect-from
|
||||
- jekyll-sitemap
|
||||
|
||||
# Exclude from processing.
|
||||
# The following items will not be processed, by default. Create a custom list
|
||||
|
||||
@@ -5,8 +5,6 @@ nav_order: 1
|
||||
has_children: false
|
||||
has_toc: false
|
||||
redirect_from:
|
||||
- /docs/opensearch-dashboards/
|
||||
- /opensearch-dashboards/
|
||||
- /dashboards/
|
||||
---
|
||||
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
---
|
||||
layout: default
|
||||
title: Helm
|
||||
parent: Install OpenSearch Dashboards
|
||||
nav_order: 35
|
||||
---
|
||||
|
||||
# Run OpenSearch Dashboards using Helm
|
||||
|
||||
Helm is a package manager that allows you to easily install and manage OpenSearch Dashboards in a Kubernetes cluster. You can define your OpenSearch configurations in a YAML file and use Helm to deploy your applications in a version-controlled and reproducible way.
|
||||
|
||||
The Helm chart contains the resources described in the following table.
|
||||
|
||||
Resource | Description
|
||||
:--- | :---
|
||||
`Chart.yaml` | Information about the chart.
|
||||
`values.yaml` | Default configuration values for the chart.
|
||||
`templates` | Templates that combine with values to generate the Kubernetes manifest files.
|
||||
|
||||
The specification in the default Helm chart supports many standard use cases and setups. You can modify the default chart to configure your desired specifications and set Transport Layer Security (TLS) and role-based access control (RBAC).
|
||||
|
||||
For information about the default configuration, steps to configure security, and configurable parameters, see the
|
||||
[README](https://github.com/opensearch-project/opensearch-devops/blob/main/Helm/README.md).
|
||||
|
||||
The instructions here assume you have a Kubernetes cluster with Helm preinstalled. See the [Kubernetes documentation](https://kubernetes.io/docs/setup/) for steps to configure a Kubernetes cluster and the [Helm documentation](https://helm.sh/docs/intro/install/) to install Helm.
|
||||
{: .note }
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before you get started, you must first use [Helm to install OpenSearch]({{site.url}}{{site.baseurl}}/opensearch/install/helm/).
|
||||
|
||||
Make sure that you can send requests to your OpenSearch pod:
|
||||
|
||||
```json
|
||||
$ curl -XGET https://localhost:9200 -u 'admin:admin' --insecure
|
||||
{
|
||||
"name" : "opensearch-cluster-master-1",
|
||||
"cluster_name" : "opensearch-cluster",
|
||||
"cluster_uuid" : "hP2gq5bPS3SLp8Z7wXm8YQ",
|
||||
"version" : {
|
||||
"distribution" : "opensearch",
|
||||
"number" : "1.0.0",
|
||||
"build_type" : "tar",
|
||||
"build_hash" : "34550c5b17124ddc59458ef774f6b43a086522e3",
|
||||
"build_date" : "2021-07-02T23:22:21.383695Z",
|
||||
"build_snapshot" : false,
|
||||
"lucene_version" : "8.8.2",
|
||||
"minimum_wire_compatibility_version" : "6.8.0",
|
||||
"minimum_index_compatibility_version" : "6.0.0-beta1"
|
||||
},
|
||||
"tagline" : "The OpenSearch Project: https://opensearch.org/"
|
||||
}
|
||||
```
|
||||
|
||||
## Install OpenSearch Dashboards using Helm
|
||||
|
||||
1. Change to the `opensearch-dashboards` directory:
|
||||
|
||||
```bash
|
||||
cd opensearch-dashboards
|
||||
```
|
||||
|
||||
1. Package the Helm chart:
|
||||
|
||||
```bash
|
||||
helm package .
|
||||
```
|
||||
|
||||
1. Deploy OpenSearch Dashboards:
|
||||
|
||||
```bash
|
||||
helm install --generate-name opensearch-dashboards-1.0.0.tgz
|
||||
```
|
||||
The output shows you the specifications instantiated from the install.
|
||||
To customize the deployment, pass in the values that you want to override with a custom YAML file:
|
||||
|
||||
```bash
|
||||
helm install --values=customvalues.yaml opensearch-dashboards-1.0.0.tgz
|
||||
```
|
||||
|
||||
#### Sample output
|
||||
|
||||
```yaml
|
||||
NAME: opensearch-dashboards-1-1629223356
|
||||
LAST DEPLOYED: Tue Aug 17 18:02:37 2021
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 1
|
||||
TEST SUITE: None
|
||||
NOTES:
|
||||
1. Get the application URL by running these commands:
|
||||
export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=opensearch-dashboards,app.kubernetes.io/instance=op
|
||||
ensearch-dashboards-1-1629223356" -o jsonpath="{.items[0].metadata.name}")
|
||||
export CONTAINER_PORT=$(kubectl get pod --namespace default $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
|
||||
echo "Visit http://127.0.0.1:8080 to use your application"
|
||||
kubectl --namespace default port-forward $POD_NAME 8080:$CONTAINER_PORT
|
||||
```
|
||||
|
||||
To make sure your OpenSearch Dashboards pod is up and running, run the following command:
|
||||
|
||||
```bash
|
||||
$ kubectl get pods
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
opensearch-cluster-master-0 1/1 Running 0 4m35s
|
||||
opensearch-cluster-master-1 1/1 Running 0 4m35s
|
||||
opensearch-cluster-master-2 1/1 Running 0 4m35s
|
||||
opensearch-dashboards-1-1629223356-758bd8747f-8www5 1/1 Running 0 66s
|
||||
```
|
||||
|
||||
To set up port forwarding to access OpenSearch Dashboards, exit the OpenSearch shell and run the following command:
|
||||
|
||||
```bash
|
||||
$ kubectl port-forward deployment/opensearch-dashboards-1-1629223356 5601
|
||||
```
|
||||
|
||||
You can now access OpenSearch Dashboards from your browser at: http://localhost:5601.
|
||||
|
||||
|
||||
## Uninstall using Helm
|
||||
|
||||
To identify the OpenSearch Dashboards deployment that you want to delete:
|
||||
|
||||
```bash
|
||||
$ helm list
|
||||
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
|
||||
opensearch-1-1629223146 default 1 2021-08-17 17:59:07.664498239 +0000 UTCdeployedopensearch-1.0.0 1.0.0
|
||||
opensearch-dashboards-1-1629223356 default 1 2021-08-17 18:02:37.600796946 +0000 UTCdepl
|
||||
oyedopensearch-dashboards-1.0.0 1.0.0
|
||||
```
|
||||
|
||||
To delete or uninstall a deployment, run the following command:
|
||||
|
||||
```bash
|
||||
helm delete opensearch-dashboards-1-1629223356
|
||||
```
|
||||
@@ -9,4 +9,4 @@ redirect_from:
|
||||
|
||||
# Install and configure OpenSearch Dashboards
|
||||
|
||||
OpenSearch Dashboards has two installation options at this time: Docker images and tarballs.
|
||||
OpenSearch Dashboards has three installation options at this time: Docker images, tarballs, and Helm charts.
|
||||
|
||||
@@ -28,6 +28,21 @@ If you don't want to use the all-in-one installation options, you can install th
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>1.0.0</td>
|
||||
<td>
|
||||
<pre>alertingDashboards 1.0.0.0
|
||||
anomalyDetectionDashboards 1.0.0.0
|
||||
ganttChartDashboards 1.0.0.0
|
||||
indexManagementDashboards 1.0.0.0
|
||||
notebooksDashboards 1.0.0.0
|
||||
queryWorkbenchDashboards 1.0.0.0
|
||||
reportsDashboards 1.0.0.0
|
||||
securityDashboards 1.0.0.0
|
||||
traceAnalyticsDashboards 1.0.0.0
|
||||
</pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1.0.0-rc1</td>
|
||||
<td>
|
||||
|
||||
@@ -27,4 +27,4 @@ nav_order: 30
|
||||
./bin/opensearch-dashboards
|
||||
```
|
||||
|
||||
1. See the [OpenSearch Dashboards documentation]({{site.url}}{{site.baseurl}}/opensearch-dashboards/).
|
||||
1. See the [OpenSearch Dashboards documentation]({{site.url}}{{site.baseurl}}/dashboards/index/).
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
---
|
||||
layout: default
|
||||
title: Configure TLS
|
||||
parent: Install OpenSearch Dashboards
|
||||
nav_order: 40
|
||||
---
|
||||
|
||||
# Configure TLS for OpenSearch Dashboards
|
||||
|
||||
By default, for ease of testing and getting started, OpenSearch Dashboards runs over HTTP. To enable TLS for HTTPS, update the following settings in `opensearch_dashboards.yml`.
|
||||
|
||||
Setting | Description
|
||||
:--- | :---
|
||||
opensearch.ssl.verificationMode | This setting is for communications between OpenSearch and OpenSearch Dashboards. Valid values are `full`, `certificate`, or `none`. We recommend `full` if you enable TLS, which enables hostname verification. `certificate` just checks the certificate, not the hostname, and `none` performs no checks (suitable for HTTP). Default is `full`.
|
||||
opensearch.ssl.certificateAuthorities | If `opensearch.ssl.verificationMode` is `full` or `certificate`, specify the full path to one or more CA certificates that comprise a trusted chain for your OpenSearch cluster. For example, you might need to include a root CA _and_ an intermediate CA if you used the intermediate CA to issue your admin, client, and node certificates.
|
||||
server.ssl.enabled | This setting is for communications between OpenSearch Dashboards and the web browser. Set to true for HTTPS, false for HTTP.
|
||||
server.ssl.certificate | If `server.ssl.enabled` is true, specify the full path to a valid client certificate for your OpenSearch cluster. You can [generate your own]({{site.url}}{{site.baseurl}}/security-plugin/configuration/generate-certificates/) or get one from a certificate authority.
|
||||
server.ssl.key | If `server.ssl.enabled` is true, specify the full path (e.g. `/usr/share/opensearch-dashboards-1.0.0/config/my-client-cert-key.pem` to the key for your client certificate. You can [generate your own]({{site.url}}{{site.baseurl}}/security-plugin/configuration/generate-certificates/) or get one from a certificate authority.
|
||||
opensearch_security.cookie.secure | If you enable TLS for OpenSearch Dashboards, change this setting to `true`. For HTTP, set it to `false`.
|
||||
|
||||
This `opensearch_dashboards.yml` configuration shows OpenSearch and OpenSearch Dashboards running on the same machine with the demo configuration:
|
||||
|
||||
```yml
|
||||
opensearch.hosts: ["https://localhost:9200"]
|
||||
opensearch.ssl.verificationMode: full
|
||||
opensearch.username: "kibanaserver"
|
||||
opensearch.password: "kibanaserver"
|
||||
opensearch.requestHeadersWhitelist: [ authorization,securitytenant ]
|
||||
server.ssl.enabled: true
|
||||
server.ssl.certificate: /usr/share/opensearch-dashboards/config/client-cert.pem
|
||||
server.ssl.key: /usr/share/opensearch-dashboards/config/client-cert-key.pem
|
||||
opensearch.ssl.certificateAuthorities: [ "/usr/share/opensearch-dashboards/config/root-ca.pem", "/usr/share/opensearch-dashboards/config/intermediate-ca.pem" ]
|
||||
opensearch_security.multitenancy.enabled: true
|
||||
opensearch_security.multitenancy.tenants.preferred: ["Private", "Global"]
|
||||
opensearch_security.readonly_mode.roles: ["kibana_read_only"]
|
||||
opensearch_security.cookie.secure: true
|
||||
```
|
||||
|
||||
If you use the Docker install, you can pass a custom `opensearch_dashboards.yml` to the container. To learn more, see the [Docker installation page]({{site.url}}{{site.baseurl}}/opensearch/install/docker/).
|
||||
|
||||
After enabling these settings and starting OpenSearch Dashboards, you can connect to it at `https://localhost:5601`. You might have to acknowledge a browser warning if your certificates are self-signed. To avoid this sort of warning (or outright browser incompatibility), best practice is to use certificates from trusted certificate authority.
|
||||
+83
-23
@@ -1,28 +1,30 @@
|
||||
---
|
||||
layout: default
|
||||
title: Notebooks (experimental)
|
||||
title: Notebooks
|
||||
nav_order: 50
|
||||
redirect_from: /docs/notebooks/
|
||||
redirect_from: /notebooks/
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# OpenSearch Dashboards notebooks (experimental)
|
||||
# Notebooks
|
||||
|
||||
Notebooks have a known issue with [tenants]({{site.url}}{{site.baseurl}}/security-plugin/access-control/multi-tenancy/). If you open a notebook and can't see its visualizations, you might be under the wrong tenant, or you might not have access to the tenant at all.
|
||||
{: .warning }
|
||||
|
||||
An OpenSearch Dashboards notebook is an interface that lets you easily combine live visualizations and narrative text in a single notebook interface.
|
||||
An OpenSearch Dashboards notebook is an interface that lets you easily combine code snippets, live visualizations, and narrative text in a single notebook interface.
|
||||
|
||||
Notebooks let you interactively explore data by running different visualizations that you can share with team members to collaborate on a project.
|
||||
|
||||
A notebook is a document composed of two elements: OpenSearch Dashboards visualizations and paragraphs (Markdown). Choose multiple timelines to compare and contrast visualizations.
|
||||
A notebook is a document composed of two elements: code blocks (Markdown/SQL/PPL) and visualizations. Choose multiple timelines to compare and contrast visualizations.
|
||||
|
||||
You can also generate [reports]({{site.url}}{{site.baseurl}}/dashboards/reporting/) directly from your notebooks.
|
||||
|
||||
Common use cases include creating postmortem reports, designing runbooks, building live infrastructure reports, and writing documentation.
|
||||
|
||||
Tenants in OpenSearch Dashboards are spaces for saving notebooks and other OpenSearch Dashboards objects. For more information, see [OpenSearch Dashboards multi-tenancy]({{site.url}}{{site.baseurl}}/security-plugin/access-control/multi-tenancy/).
|
||||
{: .note }
|
||||
|
||||
## Get Started with notebooks
|
||||
|
||||
To get started, choose **OpenSearch Dashboards Notebooks** within OpenSearch Dashboards.
|
||||
## Get started with notebooks
|
||||
|
||||
To get started, choose **Notebooks** within OpenSearch Dashboards.
|
||||
|
||||
|
||||
### Step 1: Create a notebook
|
||||
@@ -32,28 +34,59 @@ A notebook is an interface for creating reports.
|
||||
1. Choose **Create notebook** and enter a descriptive name.
|
||||
1. Choose **Create**.
|
||||
|
||||
Choose **Notebook actions** to rename, duplicate, or delete a notebook.
|
||||
Choose **Actions** to rename, duplicate, or delete a notebook.
|
||||
|
||||

|
||||
|
||||
### Step 2: Add a paragraph
|
||||
|
||||
Paragraphs combine text and visualizations for describing data.
|
||||
Paragraphs combine code blocks and visualizations for describing data.
|
||||
|
||||
#### Add a code block
|
||||
|
||||
Code blocks support markdown, SQL, and PPL languages.
|
||||
|
||||
Specify the input language on the first line using `%[language type]` syntax.
|
||||
For example, type `%md` for markdown, `%sql` for SQL, and `%ppl` for PPL.
|
||||
|
||||
##### Sample markdown block
|
||||
|
||||
```
|
||||
%md
|
||||
Add in text formatted in markdown.
|
||||
```
|
||||
|
||||

|
||||
|
||||
##### Sample SQL block
|
||||
|
||||
```sql
|
||||
%sql
|
||||
Select * from opensearch_dashboards_sample_data_flights limit 20;
|
||||
```
|
||||
|
||||

|
||||
|
||||
##### Sample PPL block
|
||||
|
||||
```
|
||||
%ppl
|
||||
source=opensearch_dashboards_sample_data_logs | head 20
|
||||
```
|
||||
|
||||

|
||||
|
||||
|
||||
#### Add a markdown paragraph
|
||||
#### Add a visualization
|
||||
|
||||
1. To add text, choose **Add markdown paragraph**.
|
||||
1. Add rich text with markdown syntax.
|
||||
|
||||

|
||||
|
||||
|
||||
#### Add a visualization paragraph
|
||||
|
||||
1. To add a visualization, choose **Add OpenSearch Dashboards visualization paragraph**.
|
||||
1. To add a visualization, choose **Add paragraph** and select **Visualization**.
|
||||
1. In **Title**, select your visualization and choose a date range. You can choose multiple timelines to compare and contrast visualizations.
|
||||
1. To run and save a paragraph, choose **Run**.
|
||||
|
||||

|
||||
|
||||
## Paragraph actions
|
||||
|
||||
You can perform the following actions on paragraphs:
|
||||
|
||||
- Add a new paragraph to the top of a report.
|
||||
@@ -61,4 +94,31 @@ You can perform the following actions on paragraphs:
|
||||
- Run all the paragraphs at the same time.
|
||||
- Clear the outputs of all paragraphs.
|
||||
- Delete all the paragraphs.
|
||||
- Move paragraphs up and down.
|
||||
|
||||

|
||||
|
||||
## Sample notebooks
|
||||
|
||||
We prepared the following sample notebooks that showcase a variety of use cases:
|
||||
|
||||
- Using SQL to query the OpenSearch Dashboards sample flight data.
|
||||
- Using PPL to query the OpenSearch Dashboards sample web logs data.
|
||||
- Using PPL and visualizations to perform sample root cause event analysis on the OpenSearch Dashboards sample web logs data.
|
||||
|
||||
To add a sample notebook, choose **Actions** and select **Add sample notebooks**.
|
||||
|
||||

|
||||
|
||||
## Create a report
|
||||
|
||||
You can use notebooks to create PNG and PDF reports:
|
||||
|
||||
1. From the top menu bar, choose **Reporting actions**.
|
||||
1. You can choose to **Download PDF** or **Download PNG**.
|
||||
|
||||
Reports generate asynchronously in the background and might take a few minutes, depending on the size of the report. A notification appears when your report is ready to download.
|
||||
|
||||
1. To create a schedule-based report, choose **Create report definition**. For steps to create a report definition, see [Create reports using a definition]({{site.url}}{{site.baseurl}}/dashboards/reporting#create-reports-using-a-definition).
|
||||
1. To see all your reports, choose **View all reports**.
|
||||
|
||||

|
||||
|
||||
@@ -9,6 +9,9 @@ nav_order: 20
|
||||
|
||||
You can use OpenSearch Dashboards to create PNG, PDF, and CSV reports. To create reports, you must have the correct permissions. For a summary of the predefined roles and the permissions they grant, see the [security plugin]({{site.url}}{{site.baseurl}}/security-plugin/access-control/users-roles#predefined-roles).
|
||||
|
||||
CSV reports have a non-configurable 10,000 row limit. They have no explicit size limit (e.g. in MB), but extremely large documents could cause report generation to fail with an out of memory error from the V8 JavaScript engine.
|
||||
{: .tip }
|
||||
|
||||
|
||||
## Create reports from Discovery, Visualize, or Dashboard
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
message: "🔥 [OpenSearch 1.0 released on July 12th! Get it now!](/downloads.html)"
|
||||
@@ -0,0 +1,49 @@
|
||||
columns:
|
||||
-
|
||||
title: 'Get Involved'
|
||||
links:
|
||||
-
|
||||
title: Code of Conduct
|
||||
url: '/codeofconduct.html'
|
||||
-
|
||||
title: 'Forums'
|
||||
url: 'https://discuss.opendistrocommunity.dev/'
|
||||
-
|
||||
title: 'Github'
|
||||
url: 'https://github.com/opensearch-project'
|
||||
-
|
||||
title: 'Partners'
|
||||
url: '/partners/'
|
||||
-
|
||||
title: 'Community Projects'
|
||||
url: '/community_projects'
|
||||
-
|
||||
title: 'Resources'
|
||||
links:
|
||||
#-
|
||||
# title: 'Documentation'
|
||||
# url: 'https://github.com/opensearch/documentation'
|
||||
-
|
||||
title: FAQ
|
||||
url: '/faq/'
|
||||
-
|
||||
title: 'Brand Guidelines'
|
||||
url: '/brand.html'
|
||||
-
|
||||
title: 'Trademark Usage Policy'
|
||||
url: '/trademark-usage.html'
|
||||
-
|
||||
title: OpenSearch Disambiguation
|
||||
url: '/disambiguation.html'
|
||||
-
|
||||
title: 'Connect'
|
||||
links:
|
||||
# -
|
||||
# title: 'Twitter'
|
||||
# url: 'https://twitter.com/opensearch_project'
|
||||
#-
|
||||
# title: 'Facebook'
|
||||
# url: 'http://www.facebook.com/opensearch'
|
||||
-
|
||||
title: 'E-mail'
|
||||
url: 'mailto:opensearch@amazon.com'
|
||||
@@ -3,5 +3,5 @@ layout: default
|
||||
title: Javadoc
|
||||
nav_order: 1
|
||||
permalink: /javadoc/
|
||||
redirect_to: https://opensearch.org/docs/javadocs/
|
||||
redirect_to: https://opensearch.org/javadocs/
|
||||
---
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
layout: default
|
||||
nav_exclude: true
|
||||
permalink: /javadocs/
|
||||
redirect_to: https://opensearch.org/javadocs/
|
||||
---
|
||||
@@ -3,7 +3,7 @@ layout: default
|
||||
title: Index rollups
|
||||
nav_order: 35
|
||||
has_children: true
|
||||
redirect_from: /docs/ism/index-rollups/
|
||||
redirect_from: /im-plugin/index-rollups/
|
||||
has_toc: false
|
||||
---
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
layout: default
|
||||
title: Index rollups API
|
||||
parent: Index rollups
|
||||
redirect_from: /docs/ism/rollup-api/
|
||||
nav_order: 9
|
||||
---
|
||||
|
||||
@@ -20,6 +19,8 @@ Use the index rollup operations to programmatically work with index rollup jobs.
|
||||
---
|
||||
|
||||
## Create or update an index rollup job
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Creates or updates an index rollup job.
|
||||
You must provide the `seq_no` and `primary_term` parameters.
|
||||
@@ -134,6 +135,8 @@ Options | Description | Type | Required
|
||||
|
||||
|
||||
## Get an index rollup job
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Returns all information about an index rollup job based on the `rollup_id`.
|
||||
|
||||
@@ -159,6 +162,8 @@ GET _plugins/_rollup/jobs/<rollup_id>
|
||||
---
|
||||
|
||||
## Delete an index rollup job
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Deletes an index rollup job based on the `rollup_id`.
|
||||
|
||||
@@ -178,6 +183,8 @@ DELETE _plugins/_rollup/jobs/<rollup_id>
|
||||
|
||||
|
||||
## Start or stop an index rollup job
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Start or stop an index rollup job.
|
||||
|
||||
@@ -199,6 +206,8 @@ POST _plugins/_rollup/jobs/<rollup_id>/_stop
|
||||
---
|
||||
|
||||
## Explain an index rollup job
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Returns detailed metadata information about the index rollup job and its current progress.
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ layout: default
|
||||
title: Index transforms
|
||||
nav_order: 20
|
||||
has_children: true
|
||||
redirect_from: /docs/im/index-transforms/
|
||||
redirect_from: /im-plugin/index-transforms/
|
||||
has_toc: false
|
||||
---
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@ Aside from using OpenSearch Dashboards, you can also use the REST API to create,
|
||||
{:toc}
|
||||
|
||||
## Create a transform job
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Creates a transform job.
|
||||
|
||||
@@ -139,6 +141,8 @@ source_field | String | The field(s) to transform | Yes
|
||||
aggregations | JSON | The aggregations to use in the transform job. Supported aggregations are: `sum`, `max`, `min`, `value_count`, `avg`, `scripted_metric`, and `percentiles`. For more information, see [Metric Aggregations]({{site.url}}{{site.baseurl}}/opensearch/metric-agg). | Yes if not using groups
|
||||
|
||||
## Update a transform job
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Updates a transform job if `transform_id` already exists.
|
||||
|
||||
@@ -254,6 +258,8 @@ Parameter | Description | Required
|
||||
`if_primary_term` | Only perform the transform operation if the last operation that changed the transform job has the specified sequence term. | No
|
||||
|
||||
## Get a transform job's details
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Returns a transform job's details.
|
||||
|
||||
@@ -520,6 +526,8 @@ GET _plugins/_transform?size=2&from=8
|
||||
```
|
||||
|
||||
## Start a transform job
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Transform jobs created using the API are automatically enabled, but if you ever need to enable a job, you can use the `start` API operation.
|
||||
|
||||
@@ -538,6 +546,8 @@ POST _plugins/_transform/<transform_id>/_start
|
||||
```
|
||||
|
||||
## Stop a transform job
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Stops/disables a transform job.
|
||||
|
||||
@@ -556,6 +566,8 @@ POST _plugins/_transform/<transform_id>/_stop
|
||||
```
|
||||
|
||||
## Get the status of a transform job
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Returns the status and metadata of a transform job.
|
||||
|
||||
@@ -589,6 +601,8 @@ GET _plugins/_transform/<transform_id>/_explain
|
||||
```
|
||||
|
||||
## Preview a transform job's results
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Returns a preview of what a transformed index would look like.
|
||||
|
||||
@@ -674,6 +688,8 @@ POST _plugins/_transform/_preview
|
||||
```
|
||||
|
||||
## Delete a transform job
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Deletes a transform job. This operation does not delete the source or target indices.
|
||||
|
||||
|
||||
+22
-1
@@ -2,7 +2,6 @@
|
||||
layout: default
|
||||
title: ISM API
|
||||
parent: Index State Management
|
||||
redirect_from: /docs/ism/api/
|
||||
nav_order: 5
|
||||
---
|
||||
|
||||
@@ -21,6 +20,8 @@ Use the index state management operations to programmatically work with policies
|
||||
|
||||
|
||||
## Create policy
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Creates a policy.
|
||||
|
||||
@@ -138,6 +139,8 @@ PUT _plugins/_ism/policies/policy_1
|
||||
---
|
||||
|
||||
## Add policy
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Adds a policy to an index. This operation does not change the policy if the index already has one.
|
||||
|
||||
@@ -160,10 +163,16 @@ POST _plugins/_ism/add/index_1
|
||||
}
|
||||
```
|
||||
|
||||
If you use a wildcard `*` while adding a policy to an index, the ISM plugin interprets `*` as all indices, including system indices like `.opendistro-security`, which stores users, roles, and tenants. A delete action in your policy might accidentally delete all user roles and tenants in your cluster.
|
||||
Don't use the broad `*` wildcard, and instead add a prefix, such as `my-logs*`, when specifying indices with the `_ism/add` API.
|
||||
{: .warning }
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Update policy
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Updates a policy. Use the `seq_no` and `primary_term` parameters to update an existing policy. If these numbers don't match the existing policy or the policy doesn't exist, ISM throws an error.
|
||||
|
||||
@@ -281,6 +290,8 @@ PUT _plugins/_ism/policies/policy_1?if_seq_no=7&if_primary_term=1
|
||||
---
|
||||
|
||||
## Get policy
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Gets the policy by `policy_id`.
|
||||
|
||||
@@ -351,6 +362,8 @@ GET _plugins/_ism/policies/policy_1
|
||||
---
|
||||
|
||||
## Remove policy from index
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Removes any ISM policy from the index.
|
||||
|
||||
@@ -374,6 +387,8 @@ POST _plugins/_ism/remove/index_1
|
||||
---
|
||||
|
||||
## Update managed index policy
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Updates the managed index policy to a new policy (or to a new version of the policy). You can use an index pattern to update multiple indices at once. When updating multiple indices, you might want to include a state filter to only affect certain managed indices. The change policy filters out all the existing managed indices and only applies the change to the ones in the state that you specify. You can also explicitly specify the state that the managed index transitions to after the change policy takes effect.
|
||||
|
||||
@@ -410,6 +425,8 @@ POST _plugins/_ism/change_policy/index_1
|
||||
---
|
||||
|
||||
## Retry failed index
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Retries the failed action for an index. For the retry call to succeed, ISM must manage the index, and the index must be in a failed state. You can use index patterns (`*`) to retry multiple failed indices.
|
||||
|
||||
@@ -436,6 +453,8 @@ POST _plugins/_ism/retry/index_1
|
||||
---
|
||||
|
||||
## Explain index
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Gets the current state of the index. You can use index patterns to get the status of multiple indices.
|
||||
|
||||
@@ -461,6 +480,8 @@ The `plugins.index_state_management.policy_id` setting is deprecated starting fr
|
||||
---
|
||||
|
||||
## Delete policy
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Deletes the policy by `policy_id`.
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@ title: Index State Management
|
||||
nav_order: 3
|
||||
has_children: true
|
||||
redirect_from:
|
||||
- /docs/im/ism/
|
||||
- /docs/ism/
|
||||
- /im-plugin/ism/
|
||||
has_toc: false
|
||||
---
|
||||
|
||||
@@ -90,7 +89,6 @@ Make sure that the alias that you enter already exists. For more information abo
|
||||
|
||||
After you attach a policy to an index, ISM creates a job that runs every 5 minutes by default to perform policy actions, check conditions, and transition the index into different states. To change the default time interval for this job, see [Settings]({{site.url}}{{site.baseurl}}/im-plugin/ism/settings/).
|
||||
|
||||
If you want to use an OpenSearch operation to create an index with a policy already attached to it, see [create index]({{site.url}}{{site.baseurl}}/im-plugin/ism/api#create-index).
|
||||
|
||||
### Step 3: Manage indices
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ layout: default
|
||||
title: Managed Indices
|
||||
nav_order: 3
|
||||
parent: Index State Management
|
||||
redirect_from: /docs/ism/managedindices/
|
||||
has_children: false
|
||||
---
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ layout: default
|
||||
title: Policies
|
||||
nav_order: 1
|
||||
parent: Index State Management
|
||||
redirect_from: /docs/ism/policies/
|
||||
has_children: false
|
||||
---
|
||||
|
||||
@@ -94,7 +93,7 @@ For a list of available unit types, see [Supported units]({{site.url}}{{site.bas
|
||||
|
||||
ISM supports the following operations:
|
||||
|
||||
- [force_merge](#forcemerge)
|
||||
- [force_merge](#force_merge)
|
||||
- [read_only](#read_only)
|
||||
- [read_write](#read_write)
|
||||
- [replica_count](#replica_count)
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
layout: default
|
||||
title: Settings
|
||||
parent: Index State Management
|
||||
redirect_from: /docs/ism/settings/
|
||||
nav_order: 4
|
||||
---
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ layout: default
|
||||
title: Refresh search analyzer
|
||||
nav_order: 40
|
||||
has_children: false
|
||||
redirect_from: /docs/ism/refresh-analyzer/
|
||||
redirect_from: /im-plugin/refresh-analyzer/
|
||||
has_toc: false
|
||||
---
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
|
||||
<div role="contentinfo">
|
||||
<div class="subfooter">
|
||||
<div class="container">
|
||||
<h1 class="visuallyhidden">OpenSearch Links</h1>
|
||||
|
||||
{% for column in site.data.footer.columns %}
|
||||
<div class="col {% if forloop.index > 2 %}last-child{% endif %}">
|
||||
|
||||
<h2>{{ column.title }}</h2>
|
||||
<ul>
|
||||
{% for link in column.links %}
|
||||
<li><a href="{{ link.url }}">{{ link.title}}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<div class="container">
|
||||
|
||||
<a href="{{ '/' | relative_url }}"><svg viewBox="0 0 64 64" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M61.7374 23.5C60.4878 23.5 59.4748 24.513 59.4748 25.7626C59.4748 44.3813 44.3813 59.4748 25.7626 59.4748C24.513 59.4748 23.5 60.4878 23.5 61.7374C23.5 62.987 24.513 64 25.7626 64C46.8805 64 64 46.8805 64 25.7626C64 24.513 62.987 23.5 61.7374 23.5Z" fill="currentColor" />
|
||||
<path d="M48.0814 38C50.2572 34.4505 52.3615 29.7178 51.9475 23.0921C51.0899 9.36725 38.6589 -1.04463 26.9206 0.0837327C22.3253 0.525465 17.6068 4.2712 18.026 10.9805C18.2082 13.8961 19.6352 15.6169 21.9544 16.9399C24.1618 18.1992 26.9978 18.9969 30.2128 19.9011C34.0962 20.9934 38.6009 22.2203 42.063 24.7717C46.2125 27.8295 49.0491 31.3743 48.0814 38Z" fill="currentColor" />
|
||||
<path d="M3.91861 14C1.74276 17.5495 -0.361506 22.2822 0.0524931 28.9079C0.910072 42.6327 13.3411 53.0446 25.0794 51.9163C29.6747 51.4745 34.3932 47.7288 33.974 41.0195C33.7918 38.1039 32.3647 36.3831 30.0456 35.0601C27.8382 33.8008 25.0022 33.0031 21.7872 32.0989C17.9038 31.0066 13.3991 29.7797 9.93694 27.2283C5.78746 24.1704 2.95092 20.6257 3.91861 14Z" fill="currentColor" />
|
||||
</svg></a>
|
||||
|
||||
<p class="copyright">© {{ 'now' | date: "%Y" }}
|
||||
<a href="https://aws.amazon.com/"> Amazon Web Services</a> and individual contributors. OpenSearch is a
|
||||
<a href="/trademark-usage.html">registered trademark</a> of Amazon Web Services.</a> <br /><br />
|
||||
|
||||
© 2005-2021
|
||||
<a href="https://www.djangoproject.com/foundation/"> Django Software
|
||||
Foundation</a> and individual contributors. Django is a
|
||||
<a href="https://www.djangoproject.com/trademarks/">registered
|
||||
trademark</a> of the Django Software Foundation.<br />
|
||||
This website was forked from the BSD-licensed <a href="https://github.com/django/djangoproject.com/">djangoproject.com</a> originally designed by <a href="https://www.threespot.com">Threespot</a> <span class="ampersand">&</span> <a href="http://andrevv.com/">andrevv</a>.<br /> We ♡ Django and the Django community. If you need a <a href="https://www.djangoproject.com/">high-level Python framework</a>, check it out.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,41 @@
|
||||
{% assign url_full = site.baseurl | append: page.url %}
|
||||
{% assign url_parts = url_full | split: "/" %}
|
||||
{%if page.alert %}
|
||||
<div role="banner" class="banner-alert">
|
||||
<div class="container">
|
||||
{{page.alert | markdownify}}
|
||||
</div>
|
||||
</div>
|
||||
{%endif%}
|
||||
{%if site.data.alert.message %}
|
||||
<div role="banner" class="banner-alert">
|
||||
<div class="container">
|
||||
{{site.data.alert.message | markdownify}}
|
||||
</div>
|
||||
</div>
|
||||
{%endif%}
|
||||
<div role="banner" id="top">
|
||||
<div class="container">
|
||||
<a class="logo" href="/">
|
||||
OpenSearch
|
||||
<svg viewBox="0 0 372 72" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M61.7374 26.5C60.4878 26.5 59.4748 27.513 59.4748 28.7626C59.4748 47.3814 44.3814 62.4748 25.7626 62.4748C24.513 62.4748 23.5 63.4878 23.5 64.7374C23.5 65.987 24.513 67 25.7626 67C46.8805 67 64 49.8805 64 28.7626C64 27.513 62.987 26.5 61.7374 26.5Z" fill="#00A3E0"/>
|
||||
<path d="M48.0814 41C50.2572 37.4505 52.3615 32.7178 51.9475 26.0921C51.0899 12.3673 38.6589 1.95537 26.9206 3.08373C22.3253 3.52547 17.6068 7.2712 18.026 13.9805C18.2082 16.8961 19.6352 18.6169 21.9544 19.9399C24.1618 21.1992 26.9978 21.9969 30.2128 22.9011C34.0962 23.9934 38.6009 25.2203 42.0631 27.7717C46.2125 30.8296 49.0491 34.3743 48.0814 41Z" fill="#B9D9EB"/>
|
||||
<path d="M3.91861 17C1.74276 20.5495 -0.361506 25.2822 0.0524931 31.9079C0.910072 45.6327 13.3411 56.0446 25.0794 54.9163C29.6747 54.4745 34.3932 50.7288 33.974 44.0195C33.7918 41.1039 32.3647 39.3831 30.0456 38.0601C27.8382 36.8008 25.0022 36.0031 21.7872 35.0989C17.9038 34.0066 13.3991 32.7797 9.93695 30.2283C5.78747 27.1704 2.95092 23.6257 3.91861 17Z" fill="#00A3E0"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M362.5 31V54H371.5V29C371.5 24.3927 370.6 20.9121 368.799 18.5511C366.998 16.1672 364.282 15 360.75 15C356.918 15 353.847 17.2408 352 21H351.5C351.636 19.0591 351.76 17.9472 351.85 17.1353C351.943 16.298 352 15.7797 352 15V0.5H343V54H352.5V35.5C352.5 31.3511 352.639 28.2815 353.493 26.081C354.347 23.8575 355.836 22.7458 357.96 22.7458C360.799 22.7458 362.5 25.3841 362.5 31ZM231.852 51.2289C234.284 48.7148 235.5 45.0936 235.5 40.3653C235.5 37.4129 234.834 34.7835 233.501 32.477C232.191 30.1705 229.865 27.9102 226.521 25.6959C224.042 24.0814 222.3 22.6398 221.294 21.3713C220.312 20.1027 219.821 18.615 219.821 16.9082C219.821 15.1783 220.23 13.8175 221.049 12.8257C221.891 11.8108 223.083 11.3034 224.627 11.3034C226.03 11.3034 227.339 11.5571 228.555 12.0645C229.794 12.572 230.975 13.1486 232.098 13.7944L235.254 6.25216C231.63 4.08405 227.854 3 223.925 3C219.809 3 216.524 4.26857 214.069 6.80572C211.637 9.34287 210.421 12.7796 210.421 17.1158C210.421 19.3761 210.725 21.3597 211.333 23.0665C211.964 24.7733 212.841 26.3187 213.964 27.7026C215.109 29.0634 216.781 30.4935 218.979 31.9927C221.505 33.6995 223.317 35.2564 224.416 36.6633C225.515 38.0472 226.065 39.5811 226.065 41.2648C226.065 42.9716 225.597 44.3209 224.662 45.3127C223.75 46.3045 222.382 46.8004 220.558 46.8004C217.354 46.8004 213.835 45.5664 210 43.0985V52.4052C213.133 54.1351 216.933 55 221.4 55C225.959 55 229.444 53.743 231.852 51.2289ZM241.674 49.8745C244.48 53.2915 248.306 55 253.152 55C257.303 55 260.862 54.1111 263.83 52.3333V44.7489C260.677 46.619 257.593 47.5541 254.578 47.5541C252.213 47.5541 250.358 46.7229 249.013 45.0606C247.668 43.3752 247.07 40.9401 247 37.5H265.5V32.4545C265.5 26.9365 264.283 22.6537 261.848 19.6061C259.413 16.5354 256.086 15 251.865 15C247.343 15 243.819 16.7893 241.291 20.368C238.764 23.9466 237.5 28.9221 237.5 35.2944C237.5 41.5743 238.891 46.4343 241.674 49.8745ZM248.526 24.2121C249.384 22.8038 250.474 22.0996 251.796 22.0996C253.21 22.0996 254.323 22.8268 255.135 24.2814C255.946 25.7359 256.454 28.1833 256.5 31H247C247.139 28.0678 247.668 25.5974 248.526 24.2121ZM288 54L286.5 49H286C284.622 51.2587 283.295 52.868 281.824 53.7208C280.352 54.5736 278.494 55 276.252 55C273.378 55 271.112 53.9398 269.453 51.8194C267.818 49.6989 267 46.7488 267 42.9689C267 38.9124 268.121 35.9046 270.364 33.9455C272.63 31.9634 276.006 30.8686 280.492 30.6612L285.678 30.4538V27.688C285.678 24.0925 284.101 22.2947 280.947 22.2947C278.611 22.2947 275.924 23.1936 272.887 24.9914L269.663 18.6301C273.541 16.21 277.694 15 282.25 15C286.385 15 289.592 16.1755 291.741 18.5264C293.914 20.8542 295 24.1616 295 28.4486V54H288ZM280.071 47.809C281.777 47.809 283.132 47.0599 284.136 45.5618C285.164 44.0406 285.678 42.0239 285.678 39.5117V36.2619L282.805 36.4002C280.679 36.5154 279.113 37.1147 278.109 38.1979C277.128 39.2812 276.637 40.8946 276.637 43.038C276.637 46.2187 277.782 47.809 280.071 47.809ZM318 15.75C316.93 15.405 315.337 15 314.222 15C312.651 15 311.273 15.5174 310.089 16.5523C308.905 17.5872 308.002 18.5853 307 21H306.5L305 16H298V54H307.463V34C307.463 30.6424 307.676 28.4763 308.86 26.7285C310.044 24.9577 311.74 24.0723 313.948 24.0723C314.973 24.0723 315.863 24.27 316.5 24.5L318 15.75ZM332 55C327.443 55 323.954 53.478 321.573 50.1302C319.191 46.7824 318 41.8647 318 35.377C318 28.5891 319.122 23.5213 321.366 20.1735C323.634 16.8257 327.017 15 331.735 15C333.154 15 334.752 15.3596 336.309 15.7752C337.866 16.1908 339.763 16.715 341 17.5L337.889 24.7449C335.989 23.6136 334.305 23.048 332.84 23.048C330.893 23.048 329.485 24.0754 328.614 26.1302C327.767 28.162 327.344 31.2211 327.344 35.3077C327.344 39.3019 327.767 42.2918 328.614 44.2774C329.462 46.2399 330.847 47.2211 332.771 47.2211C335.061 47.2211 337.454 46.413 339.95 44.7969V52.9008C337.546 54.4015 334.908 55 332 55Z" fill="#B9D9EB"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M107.777 48.2625C110.926 43.7708 112.5 37.3442 112.5 28.9827C112.5 20.6213 110.937 14.2062 107.812 9.73754C104.686 5.24585 100.194 3 94.3368 3C88.4098 3 83.8719 5.23433 80.7231 9.70299C77.5744 14.1486 76 20.5522 76 28.9136C76 37.3442 77.5744 43.8053 80.7231 48.297C83.8719 52.7657 88.3866 55 94.2674 55C100.125 55 104.628 52.7542 107.777 48.2625ZM87.8425 42.1468C86.3839 39.1293 85.6546 34.7413 85.6546 28.9827C85.6546 23.2011 86.3839 18.8131 87.8425 15.8186C89.3011 12.8011 91.4659 11.2924 94.3368 11.2924C99.986 11.2924 102.811 17.1891 102.811 28.9827C102.811 40.7763 99.9629 46.6731 94.2674 46.6731C91.4428 46.6731 89.3011 45.1643 87.8425 42.1468ZM128.186 53.9979C129.469 54.7387 130.85 55 132.5 55C136.03 55 138.9 53.3265 140.94 49.7612C142.98 46.196 144 41.2764 144 35.0025C144 28.6359 143.014 23.7164 141.043 20.2437C139.072 16.7479 136.345 15 132.861 15C129.24 15 126.402 17.1569 124.5 21H124L122.5 16H115.5V71.5H124.5V55C124.5 54.3518 124.367 52.1485 124 49H124.5C125.25 51.25 126.925 53.2339 128.186 53.9979ZM125.882 25.3832C126.685 23.6932 127.979 22.8482 129.767 22.8482C131.44 22.8482 132.666 23.8437 133.446 25.8347C134.248 27.8257 134.649 30.8353 134.649 34.8636C134.649 43.059 133.045 47.1567 129.836 47.1567C127.979 47.1567 126.65 46.1844 125.848 44.2397C125.046 42.295 124.645 39.1928 124.645 34.933V33.7176C124.691 29.8282 125.103 27.0501 125.882 25.3832ZM161.652 55C156.806 55 152.98 53.2915 150.174 49.8745C147.391 46.4343 146 41.5743 146 35.2944C146 28.9221 147.264 23.9466 149.791 20.368C152.319 16.7893 155.843 15 160.365 15C164.585 15 167.913 16.5354 170.348 19.6061C172.783 22.6537 174 26.9365 174 32.4545V37.5H155.5C155.57 40.9401 156.168 43.3752 157.513 45.0606C158.858 46.7229 160.713 47.5541 163.078 47.5541C166.093 47.5541 169.177 46.619 172.33 44.7489V52.3333C169.362 54.1111 165.803 55 161.652 55ZM160.296 22.0996C158.974 22.0996 157.884 22.8038 157.026 24.2121C156.168 25.5974 155.639 28.0678 155.5 31H165C164.954 28.1833 164.446 25.7359 163.635 24.2814C162.823 22.8268 161.71 22.0996 160.296 22.0996ZM196.5 31V54H205.5V29.1991C205.5 24.5589 204.623 21.0323 202.868 18.6194C201.137 16.2065 198.516 15 195.007 15C192.93 15 191.117 15.5104 189.57 16.5313C188.024 17.5289 186.831 19.2135 186 21H185.5L184.25 16H177V54H186.5V35.75C186.5 31.0402 186.673 27.8302 187.597 25.8582C188.52 23.8628 189.974 22.8652 191.96 22.8652C193.46 22.8652 194.546 23.5844 195.215 25.0229C195.885 26.4614 196.5 28.1927 196.5 31Z" fill="#00A3E0"/>
|
||||
</svg>
|
||||
</a>
|
||||
|
||||
<div class="menu-button"><i class="icon icon-reorder"></i><span>Menu</span></div>
|
||||
<div class="nav-menu-on" role="navigation">
|
||||
<ul class="small-nav">
|
||||
{%- include nav_item.html text="News" href="/blog" url_full="/blog/" url_fragment="blog" -%}
|
||||
{%- include nav_item.html text="Source" href="/source.html" url_full="/source.html" url_fragment="source" -%}
|
||||
{%- include nav_item.html text="Documentation" href="/docs" url_full="/docs/" url_fragment="docs" -%}
|
||||
{%- include nav_item.html text="Events" href="/events" url_full="/events/" url_fragment="events" -%}
|
||||
{%- include nav_item.html text="Get Started" href="/downloads.html" url_full="/downloads.html" url_fragment="downloads" -%}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,7 @@
|
||||
<li>
|
||||
{% if url_full == include.url_full %} {{ include.text }} {% else %}
|
||||
<a href="{{ include.href }}" {% if url_parts[1] == {{include.url_fragment}} %} class="in-category" {% endif %}>
|
||||
{{ include.text }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
+150
-153
@@ -38,61 +38,70 @@ layout: table_wrappers
|
||||
<path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"></path><polyline points="13 2 13 9 20 9"></polyline>
|
||||
</svg>
|
||||
</symbol>
|
||||
<symbol id="svg-grid" viewBox="0 0 24 24">
|
||||
<title>Documentation Menu</title>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="feather feather-grid">
|
||||
<rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect>
|
||||
</svg>
|
||||
</symbol>
|
||||
</svg>
|
||||
|
||||
<div class="side-bar">
|
||||
<div class="site-header">
|
||||
<a href="{{ '/' | absolute_url }}" class="site-title lh-tight">{% include title.html %}</a>
|
||||
<a href="#" id="menu-button" class="site-button">
|
||||
<svg viewBox="0 0 24 24" class="icon"><use xlink:href="#svg-menu"></use></svg>
|
||||
</a>
|
||||
</div>
|
||||
<nav role="navigation" aria-label="Main" id="site-nav" class="site-nav">
|
||||
{% assign pages_top_size = site.html_pages
|
||||
| where_exp:"item", "item.title != nil"
|
||||
| where_exp:"item", "item.parent == nil"
|
||||
| where_exp:"item", "item.nav_exclude != true"
|
||||
| size %}
|
||||
{% if pages_top_size > 0 %}
|
||||
{% include nav.html pages=site.html_pages key=nil %}
|
||||
{% endif %}
|
||||
{% if site.just_the_docs.collections %}
|
||||
{% assign collections_size = site.just_the_docs.collections | size %}
|
||||
{% for collection_entry in site.just_the_docs.collections %}
|
||||
{% assign collection_key = collection_entry[0] %}
|
||||
{% assign collection_value = collection_entry[1] %}
|
||||
{% assign collection = site[collection_key] %}
|
||||
{% if collection_value.nav_exclude != true %}
|
||||
{% if collections_size > 1 or pages_top_size > 0 %}
|
||||
{% if collection_value.nav_fold == true %}
|
||||
<ul class="nav-list nav-category-list">
|
||||
<li class="nav-list-item{% if page.collection == collection_key %} active{% endif %}">
|
||||
{%- if collection.size > 0 -%}
|
||||
<a href="#" class="nav-list-expander"><svg viewBox="0 0 24 24"><use xlink:href="#svg-arrow-right"></use></svg></a>
|
||||
{%- endif -%}
|
||||
<div class="nav-category">{{ collection_value.name }}</div>
|
||||
{% include nav.html pages=collection key=collection_key %}
|
||||
</li>
|
||||
</ul>
|
||||
{% include header.html %}
|
||||
|
||||
<main>
|
||||
<div id="main-header"></div>
|
||||
<div class="side-bar">
|
||||
<div class="site-header">
|
||||
<a href="#" id="menu-button" class="site-button">
|
||||
Documentation <svg viewBox="0 0 24 24" class="icon"><use xlink:href="#svg-grid"></use></svg>
|
||||
</a>
|
||||
</div>
|
||||
<nav role="navigation" aria-label="Main" id="site-nav" class="site-nav">
|
||||
{% assign pages_top_size = site.html_pages
|
||||
| where_exp:"item", "item.title != nil"
|
||||
| where_exp:"item", "item.parent == nil"
|
||||
| where_exp:"item", "item.nav_exclude != true"
|
||||
| size %}
|
||||
{% if pages_top_size > 0 %}
|
||||
{% include nav.html pages=site.html_pages key=nil %}
|
||||
{% endif %}
|
||||
{% if site.just_the_docs.collections %}
|
||||
{% assign collections_size = site.just_the_docs.collections | size %}
|
||||
{% for collection_entry in site.just_the_docs.collections %}
|
||||
{% assign collection_key = collection_entry[0] %}
|
||||
{% assign collection_value = collection_entry[1] %}
|
||||
{% assign collection = site[collection_key] %}
|
||||
{% if collection_value.nav_exclude != true %}
|
||||
{% if collections_size > 1 or pages_top_size > 0 %}
|
||||
{% if collection_value.nav_fold == true %}
|
||||
<ul class="nav-list nav-category-list">
|
||||
<li class="nav-list-item{% if page.collection == collection_key %} active{% endif %}">
|
||||
{%- if collection.size > 0 -%}
|
||||
<a href="#" class="nav-list-expander"><svg viewBox="0 0 24 24"><use xlink:href="#svg-arrow-right"></use></svg></a>
|
||||
{%- endif -%}
|
||||
<div class="nav-category">{{ collection_value.name }}</div>
|
||||
{% include nav.html pages=collection key=collection_key %}
|
||||
</li>
|
||||
</ul>
|
||||
{% else %}
|
||||
<div class="nav-category">{{ collection_value.name }}</div>
|
||||
{% include nav.html pages=collection key=collection_key %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<div class="nav-category">{{ collection_value.name }}</div>
|
||||
{% include nav.html pages=collection key=collection_key %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% include nav.html pages=collection key=collection_key %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</nav>
|
||||
<footer class="site-footer">
|
||||
<p class="text-small text-grey-dk-100">See a problem? Submit <a href="https://github.com/opensearch-project/documentation-website/issues">issues</a> or <a href="https://github.com/opensearch-project/documentation-website/edit/main/{{ page.path }}">edit this page</a> on <a href="https://github.com/opensearch-project/documentation-website/">GitHub</a>.</p>
|
||||
<p class="text-small text-grey-dk-100 mb-0">© 2021 OpenSearch contributors. This documentation is under the Apache License 2.0.</p>
|
||||
</footer>
|
||||
</div>
|
||||
<div class="main" id="top">
|
||||
<div id="main-header" class="main-header">
|
||||
{% if site.search_enabled != false %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</nav>
|
||||
<div class="site-footer">
|
||||
<p class="text-small text-grey-dk-100">See a problem? Submit <a href="https://github.com/opensearch-project/documentation-website/issues">issues</a> or <a href="https://github.com/opensearch-project/documentation-website/edit/main/{{ page.path }}">edit this page</a> on <a href="https://github.com/opensearch-project/documentation-website/">GitHub</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="copy-banner">
|
||||
<div class="container">
|
||||
<h1><a href="#">Documentation</a></h1>
|
||||
{% if site.search_enabled != false %}
|
||||
<div class="search">
|
||||
<div class="search-input-wrap">
|
||||
<input type="text" id="search-input" class="search-input" tabindex="0" placeholder="Search..." aria-label="Search {{ site.title }}" autocomplete="off">
|
||||
@@ -100,117 +109,105 @@ layout: table_wrappers
|
||||
</div>
|
||||
<div id="search-results" class="search-results"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% include header_custom.html %}
|
||||
{% if site.aux_links %}
|
||||
<nav aria-label="Auxiliary" class="aux-nav">
|
||||
<ul class="aux-nav-list">
|
||||
{% for link in site.aux_links %}
|
||||
<li class="aux-nav-list-item">
|
||||
<a href="{{ link.last }}" class="site-button"
|
||||
{% if site.aux_links_new_tab %}
|
||||
target="_blank" rel="noopener noreferrer"
|
||||
{% endif %}
|
||||
>
|
||||
{{ link.first }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div id="main-content-wrap" class="main-content-wrap">
|
||||
{% unless page.url == "/" %}
|
||||
{% if page.parent %}
|
||||
<nav aria-label="Breadcrumb" class="breadcrumb-nav">
|
||||
<ol class="breadcrumb-nav-list">
|
||||
{% if page.grand_parent %}
|
||||
<li class="breadcrumb-nav-list-item"><a href="{{ first_level_url }}">{{ page.grand_parent }}</a></li>
|
||||
<li class="breadcrumb-nav-list-item"><a href="{{ second_level_url }}">{{ page.parent }}</a></li>
|
||||
{% else %}
|
||||
<li class="breadcrumb-nav-list-item"><a href="{{ first_level_url }}">{{ page.parent }}</a></li>
|
||||
{% endif %}
|
||||
<li class="breadcrumb-nav-list-item"><span>{{ page.title }}</span></li>
|
||||
</ol>
|
||||
</nav>
|
||||
{% endif %}
|
||||
{% endunless %}
|
||||
<div id="main-content" class="main-content" role="main">
|
||||
{% if site.heading_anchors != false %}
|
||||
{% include vendor/anchor_headings.html html=content beforeHeading="true" anchorBody="<svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><use xlink:href=\"#svg-link\"></use></svg>" anchorClass="anchor-heading" anchorAttrs="aria-labelledby=\"%html_id%\"" %}
|
||||
{% else %}
|
||||
<p class="warning" style="margin-top: 0">This documentation remains in a beta state. It has content gaps and might contain bugs.</p>
|
||||
{{ content }}
|
||||
{% endif %}
|
||||
|
||||
{% if page.has_children == true and page.has_toc != false %}
|
||||
<hr>
|
||||
<h2 class="text-delta">Table of contents</h2>
|
||||
<ul>
|
||||
{% for child in toc_list %}
|
||||
<li>
|
||||
<a href="{{ child.url | absolute_url }}">{{ child.title }}</a>{% if child.summary %} - {{ child.summary }}{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% capture footer_custom %}
|
||||
{%- include footer_custom.html -%}
|
||||
{% endcapture %}
|
||||
{% if footer_custom != "" or site.last_edit_timestamp or site.gh_edit_link %}
|
||||
<hr>
|
||||
<footer>
|
||||
{% if site.back_to_top %}
|
||||
<p><a href="#top" id="back-to-top">{{ site.back_to_top_text }}</a></p>
|
||||
{% endif %}
|
||||
|
||||
{{ footer_custom }}
|
||||
|
||||
{% if site.last_edit_timestamp or site.gh_edit_link %}
|
||||
<div class="d-flex mt-2">
|
||||
{% if site.last_edit_timestamp and site.last_edit_time_format and page.last_modified_date %}
|
||||
<p class="text-small text-grey-dk-000 mb-0 mr-2">
|
||||
Page last modified: <span class="d-inline-block">{{ page.last_modified_date | date: site.last_edit_time_format }}</span>.
|
||||
</p>
|
||||
{% endif %}
|
||||
{% if
|
||||
site.gh_edit_link and
|
||||
site.gh_edit_link_text and
|
||||
site.gh_edit_repository and
|
||||
site.gh_edit_branch and
|
||||
site.gh_edit_view_mode
|
||||
%}
|
||||
<p class="text-small text-grey-dk-000 mb-0">
|
||||
<a href="{{ site.gh_edit_repository }}/{{ site.gh_edit_view_mode }}/{{ site.gh_edit_branch }}{% if site.gh_edit_source %}/{{ site.gh_edit_source }}{% endif %}/{{ page.path }}" id="edit-this-page">{{ site.gh_edit_link_text }}</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</footer>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="toc">
|
||||
{% include toc.html html=content h_min=2 h_max=2 class="toc-list" item_class="toc-item" sanitize=true %}
|
||||
</div>
|
||||
{% if site.search_enabled != false %}
|
||||
{% if site.search.button %}
|
||||
<a href="#" id="search-button" class="search-button">
|
||||
<svg viewBox="0 0 24 24" class="icon"><use xlink:href="#svg-search"></use></svg>
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<div class="search-overlay"></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="main" id="top">
|
||||
<div id="main-content-wrap" class="main-content-wrap">
|
||||
{% unless page.url == "/" %}
|
||||
{% if page.parent %}
|
||||
<nav aria-label="Breadcrumb" class="breadcrumb-nav">
|
||||
<ol class="breadcrumb-nav-list">
|
||||
{% if page.grand_parent %}
|
||||
<li class="breadcrumb-nav-list-item"><a href="{{ first_level_url }}">{{ page.grand_parent }}</a></li>
|
||||
<li class="breadcrumb-nav-list-item"><a href="{{ second_level_url }}">{{ page.parent }}</a></li>
|
||||
{% else %}
|
||||
<li class="breadcrumb-nav-list-item"><a href="{{ first_level_url }}">{{ page.parent }}</a></li>
|
||||
{% endif %}
|
||||
<li class="breadcrumb-nav-list-item"><span>{{ page.title }}</span></li>
|
||||
</ol>
|
||||
</nav>
|
||||
{% endif %}
|
||||
{% endunless %}
|
||||
<div id="main-content" class="main-content" role="main">
|
||||
{% if site.heading_anchors != false %}
|
||||
{% include vendor/anchor_headings.html html=content beforeHeading="true" anchorBody="<svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><use xlink:href=\"#svg-link\"></use></svg>" anchorClass="anchor-heading" anchorAttrs="aria-labelledby=\"%html_id%\"" %}
|
||||
{% else %}
|
||||
{{ content }}
|
||||
{% endif %}
|
||||
|
||||
{% if page.has_children == true and page.has_toc != false %}
|
||||
<hr>
|
||||
<h2 class="text-delta">Table of contents</h2>
|
||||
<ul>
|
||||
{% for child in toc_list %}
|
||||
<li>
|
||||
<a href="{{ child.url | absolute_url }}">{{ child.title }}</a>{% if child.summary %} - {{ child.summary }}{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% capture footer_custom %}
|
||||
{%- include footer_custom.html -%}
|
||||
{% endcapture %}
|
||||
{% if footer_custom != "" or site.last_edit_timestamp or site.gh_edit_link %}
|
||||
<hr>
|
||||
<footer>
|
||||
{% if site.back_to_top %}
|
||||
<p><a href="#top" id="back-to-top">{{ site.back_to_top_text }}</a></p>
|
||||
{% endif %}
|
||||
|
||||
{{ footer_custom }}
|
||||
|
||||
{% if site.last_edit_timestamp or site.gh_edit_link %}
|
||||
<div class="d-flex mt-2">
|
||||
{% if site.last_edit_timestamp and site.last_edit_time_format and page.last_modified_date %}
|
||||
<p class="text-small text-grey-dk-000 mb-0 mr-2">
|
||||
Page last modified: <span class="d-inline-block">{{ page.last_modified_date | date: site.last_edit_time_format }}</span>.
|
||||
</p>
|
||||
{% endif %}
|
||||
{% if
|
||||
site.gh_edit_link and
|
||||
site.gh_edit_link_text and
|
||||
site.gh_edit_repository and
|
||||
site.gh_edit_branch and
|
||||
site.gh_edit_view_mode
|
||||
%}
|
||||
<p class="text-small text-grey-dk-000 mb-0">
|
||||
<a href="{{ site.gh_edit_repository }}/{{ site.gh_edit_view_mode }}/{{ site.gh_edit_branch }}{% if site.gh_edit_source %}/{{ site.gh_edit_source }}{% endif %}/{{ page.path }}" id="edit-this-page">{{ site.gh_edit_link_text }}</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</footer>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="toc-wrap">
|
||||
<div class="toc">
|
||||
{% include toc.html html=content h_min=2 h_max=2 class="toc-list" item_class="toc-item" sanitize=true %}
|
||||
</div>
|
||||
</div>
|
||||
{% if site.search_enabled != false %}
|
||||
{% if site.search.button %}
|
||||
<a href="#" id="search-button" class="search-button">
|
||||
<svg viewBox="0 0 24 24" class="icon"><use xlink:href="#svg-search"></use></svg>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</main>
|
||||
|
||||
{% include footer.html %}
|
||||
|
||||
{% if site.anchor_links != nil %}
|
||||
<script>
|
||||
anchors.add();
|
||||
anchors.add().remove('.subfooter h1, .subfooter h2');
|
||||
</script>
|
||||
{% endif %}
|
||||
<script src="{{ '/assets/js/header-nav.js' | relative_url }}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
---
|
||||
layout: default
|
||||
title: Docker migration
|
||||
nav_order: 25
|
||||
---
|
||||
|
||||
# Docker migration
|
||||
|
||||
If you use a container orchestration system like Kubernetes (or manage your containers manually) and want to avoid downtime, think of the process not as an upgrade of each node, but as a decommissioning and replacement of each node. One by one, add OpenSearch nodes to the cluster and remove Elasticsearch OSS nodes, allowing time for all indices to return to a green status prior to proceeding.
|
||||
|
||||
If you use Docker Compose, we highly recommend that you perform what amounts to a [cluster restart upgrade]({{site.url}}{{site.baseurl}}/migrate/upgrade-migrate/). Update your cluster configuration with new images, new settings, and new environment variables, and test it. Then stop and start the cluster. This process requires downtime, but takes very few steps and lets you continue to treat the cluster as a single entity that you can reliably deploy and redeploy.
|
||||
|
||||
The most important step is to leave your data volumes intact. **Don't** run `docker-compose down -v`.
|
||||
@@ -1,13 +0,0 @@
|
||||
---
|
||||
layout: default
|
||||
title: About migrating
|
||||
nav_order: 1
|
||||
redirect_from: /migrate/
|
||||
---
|
||||
|
||||
# About migrating
|
||||
|
||||
The process of migrating from Elasticsearch OSS (including Open Distro for Elasticsearch) to OpenSearch varies depending on your current version of Elasticsearch OSS, install type, tolerance for downtime, and cost-sensitivity. Rather than concrete steps to cover every situation, we have general guidance for the process.
|
||||
|
||||
To safeguard against data loss, we recommend that you take a [snapshot]({{site.url}}{{site.baseurl}}/opensearch/snapshot-restore/) of all indices prior to any migration.
|
||||
{: .tip }
|
||||
@@ -19,6 +19,8 @@ Use these anomaly detection operations to programmatically create and manage det
|
||||
---
|
||||
|
||||
## Create anomaly detector
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Creates an anomaly detector.
|
||||
|
||||
@@ -306,6 +308,8 @@ Options | Description | Type | Required
|
||||
---
|
||||
|
||||
## Preview detector
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Passes a date range to the anomaly detector to return any anomalies within that date range.
|
||||
|
||||
@@ -445,6 +449,8 @@ If you specify a category field, each result is associated with an entity:
|
||||
---
|
||||
|
||||
## Start detector job
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Starts a real-time or historical anomaly detector job.
|
||||
|
||||
@@ -470,6 +476,8 @@ POST _plugins/_anomaly_detection/detectors/<detectorId>/_start
|
||||
---
|
||||
|
||||
## Stop detector job
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Stops a real-time or historical anomaly detector job.
|
||||
|
||||
@@ -488,6 +496,8 @@ Stopped detector: m4ccEnIBTXsGi3mvMt9p
|
||||
---
|
||||
|
||||
## Search detector result
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Returns all results for a search query.
|
||||
|
||||
@@ -933,6 +943,8 @@ GET _plugins/_anomaly_detection/detectors/results/_search
|
||||
---
|
||||
|
||||
## Delete detector
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Deletes a detector based on the `detector_id`.
|
||||
To delete a detector, you need to first stop the detector.
|
||||
@@ -968,6 +980,8 @@ DELETE _plugins/_anomaly_detection/detectors/<detectorId>
|
||||
---
|
||||
|
||||
## Update detector
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Updates a detector with any changes, including the description or adding or removing of features.
|
||||
To update a detector, you need to first stop the detector.
|
||||
@@ -1139,6 +1153,8 @@ PUT _plugins/_anomaly_detection/detectors/<detectorId>
|
||||
---
|
||||
|
||||
## Get detector
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Returns all information about a detector based on the `detector_id`.
|
||||
|
||||
@@ -1485,6 +1501,8 @@ GET _plugins/_anomaly_detection/detectors/<detectorId>?task=true
|
||||
---
|
||||
|
||||
## Search detector
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Returns all anomaly detectors for a search query.
|
||||
|
||||
@@ -1591,6 +1609,8 @@ Sample Input:
|
||||
---
|
||||
|
||||
## Get detector stats
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Provides information about how the plugin is performing.
|
||||
|
||||
@@ -1691,6 +1711,8 @@ Historical detectors contain additional fields:
|
||||
---
|
||||
|
||||
## Create monitor
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Create a monitor to set up alerts for the detector.
|
||||
|
||||
@@ -1909,6 +1931,8 @@ POST _plugins/_alerting/monitors
|
||||
---
|
||||
|
||||
## Profile detector
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Returns information related to the current state of the detector and memory usage, including current errors and shingle size, to help troubleshoot the detector.
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ An anomaly in OpenSearch is any unusual behavior change in your time-series data
|
||||
|
||||
It can be challenging to discover anomalies using conventional methods such as creating visualizations and dashboards. You could configure an alert based on a static threshold, but this requires prior domain knowledge and isn't adaptive to data that exhibits organic growth or seasonal behavior.
|
||||
|
||||
Anomaly detection automatically detects anomalies in your OpenSearch data in near real-time using the Random Cut Forest (RCF) algorithm. RCF is an unsupervised machine learning algorithm that models a sketch of your incoming data stream to compute an `anomaly grade` and `confidence score` value for each incoming data point. These values are used to differentiate an anomaly from normal variations. For more information about how RCF works, see [Random Cut Forests](https://pdfs.semanticscholar.org/8bba/52e9797f2e2cc9a823dbd12514d02f29c8b9.pdf?_ga=2.56302955.1913766445.1574109076-1059151610.1574109076).
|
||||
Anomaly detection automatically detects anomalies in your OpenSearch data in near real-time using the Random Cut Forest (RCF) algorithm. RCF is an unsupervised machine learning algorithm that models a sketch of your incoming data stream to compute an `anomaly grade` and `confidence score` value for each incoming data point. These values are used to differentiate an anomaly from normal variations. For more information about how RCF works, see [Random Cut Forests](https://api.semanticscholar.org/CorpusID:927435).
|
||||
|
||||
You can pair the anomaly detection plugin with the [alerting plugin]({{site.url}}{{site.baseurl}}/monitoring-plugins/alerting/) to notify you as soon as an anomaly is detected.
|
||||
|
||||
@@ -79,13 +79,11 @@ This formula provides a good starting point, but make sure to test with a repres
|
||||
|
||||
For example, for a cluster with 3 data nodes, each with 8G of JVM heap size, a maximum memory percentage of 10% (default), and the entity size of the detector as 1MB: the total number of unique entities supported is (8.096 * 10^9 * 0.1 / 1M ) * 3 = 2429.
|
||||
|
||||
#### Set a window size
|
||||
#### Set a shingle size
|
||||
|
||||
Set the number of aggregation intervals from your data stream to consider in a detection window. It's best to choose this value based on your actual data to see which one leads to the best results for your use case.
|
||||
Set the number of aggregation intervals from your data stream to consider in a detection window. It’s best to choose this value based on your actual data to see which one leads to the best results for your use case.
|
||||
|
||||
Based on experiments performed on a wide variety of one-dimensional data streams, we recommend using a window size between 1 and 16. The default window size is 8. If you set the category field for high cardinality, the default window size is 1.
|
||||
|
||||
If you expect missing values in your data or if you want to base the anomalies on the current interval, choose 1. If your data is continuously ingested and you want to base the anomalies on multiple intervals, choose a larger window size.
|
||||
The anomaly detector expects the shingle size to be in the range of 1 and 60. The default shingle size is 8. We recommend that you don't choose 1 unless you have two or more features. Smaller values might increase [recall](https://en.wikipedia.org/wiki/Precision_and_recall) but also false positives. Larger values might be useful for ignoring noise in a signal.
|
||||
|
||||
#### Preview sample anomalies
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@ Use the alerting API to programmatically manage monitors and alerts.
|
||||
---
|
||||
|
||||
## Create monitor
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
#### Request
|
||||
|
||||
@@ -246,6 +248,8 @@ For a full list of timezone names, refer to [Wikipedia](https://en.wikipedia.org
|
||||
---
|
||||
|
||||
## Update monitor
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
When you update a monitor, include the current version number as a parameter. OpenSearch increments the version number automatically (see the sample response).
|
||||
|
||||
@@ -368,6 +372,8 @@ PUT _plugins/_alerting/monitors/<monitor_id>
|
||||
---
|
||||
|
||||
## Get monitor
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
#### Request
|
||||
|
||||
@@ -438,6 +444,8 @@ GET _plugins/_alerting/monitors/<monitor_id>
|
||||
---
|
||||
|
||||
## Monitor stats
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Returns statistics about the alerting feature. Use `_plugins/_alerting/stats` to find node IDs and metrics. Then you can drill down using those values.
|
||||
|
||||
@@ -627,6 +635,8 @@ GET _plugins/_alerting/<node-id>/stats/<metric>
|
||||
---
|
||||
|
||||
## Delete monitor
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
#### Request
|
||||
|
||||
@@ -658,6 +668,8 @@ DELETE _plugins/_alerting/monitors/<monitor_id>
|
||||
---
|
||||
|
||||
## Search monitors
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
#### Request
|
||||
|
||||
@@ -755,6 +767,8 @@ GET _plugins/_alerting/monitors/_search
|
||||
---
|
||||
|
||||
## Run monitor
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
You can add the optional `?dryrun=true` parameter to the URL to show the results of a run without actions sending any message.
|
||||
|
||||
@@ -787,6 +801,8 @@ POST _plugins/_alerting/monitors/<monitor_id>/_execute
|
||||
---
|
||||
|
||||
## Get alerts
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Returns an array of all alerts.
|
||||
|
||||
@@ -855,8 +871,10 @@ GET _plugins/_alerting/monitors/alerts
|
||||
---
|
||||
|
||||
## Acknowledge alert
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
[After getting your alerts](#get-alerts/), you can acknowledge any number of active alerts in one call. If the alert is already in an ERROR, COMPLETED, or ACKNOWLEDGED state, it appears in the `failed` array.
|
||||
[After getting your alerts](#get-alerts), you can acknowledge any number of active alerts in one call. If the alert is already in an ERROR, COMPLETED, or ACKNOWLEDGED state, it appears in the `failed` array.
|
||||
|
||||
|
||||
#### Request
|
||||
@@ -882,6 +900,8 @@ POST _plugins/_alerting/monitors/<monitor-id>/_acknowledge/alerts
|
||||
---
|
||||
|
||||
## Create destination
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
#### Requests
|
||||
|
||||
@@ -912,6 +932,27 @@ POST _plugins/_alerting/destinations
|
||||
"host": "hooks.chime.aws"
|
||||
}
|
||||
}
|
||||
|
||||
POST _plugins/_alerting/destinations
|
||||
{
|
||||
"type": "email",
|
||||
"name": "my-email-destination",
|
||||
"email": {
|
||||
"email_account_id": "YjY7mXMBx015759_IcfW",
|
||||
"recipients": [
|
||||
{
|
||||
"type": "email_group",
|
||||
"email_group_id": "YzY-mXMBx015759_dscs"
|
||||
},
|
||||
{
|
||||
"type": "email",
|
||||
"email": "example@email.com"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
// The email_account_id and email_group_id will be the document IDs of the email_account and email_group you have created.
|
||||
```
|
||||
|
||||
#### Sample response
|
||||
@@ -935,6 +976,8 @@ POST _plugins/_alerting/destinations
|
||||
---
|
||||
|
||||
## Update destination
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
#### Request
|
||||
|
||||
@@ -970,6 +1013,8 @@ PUT _plugins/_alerting/destinations/<destination-id>
|
||||
---
|
||||
|
||||
## Get destination
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Retrieve one destination.
|
||||
|
||||
@@ -1015,6 +1060,8 @@ GET _plugins/_alerting/destinations/<destination-id>
|
||||
---
|
||||
|
||||
## Get destinations
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Retrieve all destinations.
|
||||
|
||||
@@ -1060,6 +1107,8 @@ GET _plugins/_alerting/destinations
|
||||
---
|
||||
|
||||
## Delete destination
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
#### Request
|
||||
|
||||
@@ -1089,6 +1138,8 @@ DELETE _plugins/_alerting/destinations/<destination-id>
|
||||
---
|
||||
|
||||
## Create email account
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
#### Request
|
||||
```json
|
||||
@@ -1121,6 +1172,8 @@ POST _plugins/_alerting/destinations/email_accounts
|
||||
```
|
||||
|
||||
## Update email account
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
#### Request
|
||||
```json
|
||||
@@ -1152,6 +1205,8 @@ PUT _plugins/_alerting/destinations/email_accounts/<email_account_id>
|
||||
```
|
||||
|
||||
## Get email account
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
#### Request
|
||||
```json
|
||||
@@ -1183,6 +1238,8 @@ GET _plugins/_alerting/destinations/email_accounts/<email_account_id>
|
||||
```
|
||||
|
||||
## Delete email account
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
#### Request
|
||||
```
|
||||
@@ -1209,6 +1266,8 @@ DELETE _plugins/_alerting/destinations/email_accounts/<email_account_id>
|
||||
```
|
||||
|
||||
## Search email account
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
#### Request
|
||||
|
||||
@@ -1275,6 +1334,8 @@ POST _plugins/_alerting/destinations/email_accounts/_search
|
||||
---
|
||||
|
||||
## Create email group
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
#### Request
|
||||
|
||||
@@ -1309,6 +1370,8 @@ POST _plugins/_alerting/destinations/email_groups
|
||||
```
|
||||
|
||||
## Update email group
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
#### Request
|
||||
|
||||
@@ -1342,6 +1405,8 @@ PUT _plugins/_alerting/destinations/email_groups/<email_group_id>
|
||||
```
|
||||
|
||||
## Get email group
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
#### Request
|
||||
```json
|
||||
@@ -1374,6 +1439,8 @@ GET _plugins/_alerting/destinations/email_groups/<email_group_id>
|
||||
```
|
||||
|
||||
## Delete email group
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
#### Request
|
||||
```
|
||||
@@ -1400,6 +1467,8 @@ DELETE _plugins/_alerting/destinations/email_groups/<email_group_id>
|
||||
```
|
||||
|
||||
## Search email group
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
#### Request
|
||||
|
||||
|
||||
@@ -4,9 +4,6 @@ title: Cron
|
||||
nav_order: 20
|
||||
parent: Alerting
|
||||
has_children: false
|
||||
redirect_from:
|
||||
- /alerting/cron/
|
||||
- /docs/alerting/cron/
|
||||
---
|
||||
|
||||
# Cron expression reference
|
||||
|
||||
@@ -34,7 +34,7 @@ Destination | A reusable location for an action, such as Amazon Chime, Slack, or
|
||||
1. Specify a name for the destination so that you can identify it later.
|
||||
1. For **Type**, choose Slack, Amazon Chime, custom webhook, or [email](#email-as-a-destination).
|
||||
|
||||
For Email type, refer to [Email as a destination](#email-as-a-destination) section below. For all other types, specify the webhook URL. For more information about webhooks, see the documentation for [Slack](https://api.slack.com/incoming-webhooks) and [Chime](https://docs.aws.amazon.com/chime/latest/ug/webhooks.html).
|
||||
For Email type, refer to [Email as a destination](#email-as-a-destination) section below. For all other types, specify the webhook URL. For more information about webhooks, see the documentation for [Slack](https://api.slack.com/incoming-webhooks) and [Amazon Chime](https://docs.aws.amazon.com/chime/latest/ug/webhooks.html).
|
||||
|
||||
For custom webhooks, you must specify more information: parameters and headers. For example, if your endpoint requires basic authentication, you might need to add a header with a key of `Authorization` and a value of `Basic <Base64-encoded-credential-string>`. You might also need to change `Content-Type` to whatever your webhook requires. Popular values are `application/json`, `application/xml`, and `text/plain`.
|
||||
|
||||
@@ -296,7 +296,7 @@ Variable | Data Type | Description
|
||||
`ctx.trigger.actions.destination_id`| String | The alert destination's ID.
|
||||
`ctx.trigger.actions.message_template.source` | String | The message to send in the alert.
|
||||
`ctx.trigger.actions.message_template.lang` | String | The scripting language used to define the message. Must be Mustache.
|
||||
`ctx.trigger.actions.throttle_enabled` | Boolean | Whether throttling is enabled for this trigger. See [adding actions](#add-actions/) for more information about throttling.
|
||||
`ctx.trigger.actions.throttle_enabled` | Boolean | Whether throttling is enabled for this trigger. See [adding actions](#add-actions) for more information about throttling.
|
||||
`ctx.trigger.actions.subject_template.source` | String | The message's subject in the alert.
|
||||
`ctx.trigger.actions.subject_template.lang` | String | The scripting language used to define the subject. Must be mustache.
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ nav_order: 1
|
||||
---
|
||||
|
||||
# Performance Analyzer API
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
Performance Analyzer uses a single HTTP method and URI for most requests:
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ Data Prepper is an independent component, not an OpenSearch plugin, that convert
|
||||
To use the Docker image, pull it like any other image:
|
||||
|
||||
```bash
|
||||
docker pull opensearch/opensearch-data-prepper:latest
|
||||
docker pull opensearchproject/data-prepper:latest
|
||||
```
|
||||
|
||||
Otherwise, [download](https://opensearch.org/downloads.html) the appropriate archive for your operating system and unzip it.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
title: Aggregations
|
||||
nav_order: 13
|
||||
nav_order: 14
|
||||
has_children: true
|
||||
---
|
||||
|
||||
|
||||
@@ -660,7 +660,7 @@ GET opensearch_dashboards_sample_data_logs/_search
|
||||
```
|
||||
|
||||
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](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) notation.
|
||||
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.
|
||||
|
||||
```json
|
||||
GET opensearch_dashboards_sample_data_logs/_search
|
||||
@@ -1026,7 +1026,7 @@ GET opensearch_dashboards_sample_data_logs/_search
|
||||
|
||||
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.
|
||||
|
||||
The number of results returned by a query might be far too many to display each geo point individually on a map. The `geohash_grid` aggregation buckets nearby geo points 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](http://en.wikipedia.org/wiki/Geohash).
|
||||
The number of results returned by a query might be far too many to display each geo point individually on a map. The `geohash_grid` aggregation buckets nearby geo points 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).
|
||||
|
||||
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:
|
||||
|
||||
|
||||
@@ -1,256 +0,0 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT API
|
||||
nav_order: 20
|
||||
---
|
||||
|
||||
# cat API
|
||||
|
||||
You can get essential statistics about your cluster in an easy-to-understand, tabular format using the compact and aligned text (CAT) API. The cat API is a human-readable interface that returns plain text instead of traditional JSON.
|
||||
|
||||
Using the cat API, you can answer questions like which node is the elected master, what state is the cluster in, how many documents are in each index, and so on.
|
||||
|
||||
To see the available operations in the cat API, use the following command:
|
||||
|
||||
```
|
||||
GET _cat
|
||||
```
|
||||
|
||||
You can also use the following string parameters with your query.
|
||||
|
||||
Parameter | Description
|
||||
:--- | :--- |
|
||||
`?v` | Makes the output more verbose by adding headers to the columns. It also adds some formatting to help align each of the columns together. All examples on this page include the `v` parameter.
|
||||
`?help` | Lists the default and other available headers for a given operation.
|
||||
`?h` | Limits the output to specific headers.
|
||||
`?format` | Outputs the result in JSON, YAML, or CBOR formats.
|
||||
`?sort` | Sorts the output by the specified columns.
|
||||
|
||||
To see what each column represents, use the `?v` parameter:
|
||||
|
||||
```
|
||||
GET _cat/<operation_name>?v
|
||||
```
|
||||
|
||||
To see all the available headers, use the `?help` parameter:
|
||||
|
||||
```
|
||||
GET _cat/<operation_name>?help
|
||||
```
|
||||
|
||||
To limit the output to a subset of headers, use the `?h` parameter:
|
||||
|
||||
```
|
||||
GET _cat/<operation_name>?h=<header_name_1>,<header_name_2>&v
|
||||
```
|
||||
|
||||
Typically, for any operation you can find out what headers are available using the `?help` parameter, and then use the `?h` parameter to limit the output to only the headers that you care about.
|
||||
|
||||
---
|
||||
|
||||
#### Table of contents
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
---
|
||||
## Aliases
|
||||
|
||||
Lists the mapping of aliases to indices, plus routing and filtering information.
|
||||
|
||||
```
|
||||
GET _cat/aliases?v
|
||||
```
|
||||
|
||||
To limit the information to a specific alias, add the alias name after your query.
|
||||
|
||||
```
|
||||
GET _cat/aliases/<alias>?v
|
||||
```
|
||||
|
||||
## Allocation
|
||||
|
||||
Lists the allocation of disk space for indices and the number of shards on each node.
|
||||
Default request:
|
||||
```
|
||||
GET _cat/allocation?v
|
||||
```
|
||||
|
||||
## Count
|
||||
|
||||
Lists the number of documents in your cluster.
|
||||
|
||||
```
|
||||
GET _cat/count?v
|
||||
```
|
||||
|
||||
To see the number of documents in a specific index, add the index name after your query.
|
||||
|
||||
```
|
||||
GET _cat/count/<index>?v
|
||||
```
|
||||
|
||||
## Field data
|
||||
|
||||
Lists the memory size used by each field per node.
|
||||
|
||||
```
|
||||
GET _cat/fielddata?v
|
||||
```
|
||||
|
||||
To limit the information to a specific field, add the field name after your query.
|
||||
|
||||
```
|
||||
GET _cat/fielddata/<fields>?v
|
||||
```
|
||||
|
||||
## Health
|
||||
|
||||
Lists the status of the cluster, how long the cluster has been up, the number of nodes, and other useful information that helps you analyze the health of your cluster.
|
||||
|
||||
```
|
||||
GET _cat/health?v
|
||||
```
|
||||
|
||||
## Indices
|
||||
|
||||
Lists information related to indices—how much disk space they are using, how many shards they have, their health status, and so on.
|
||||
|
||||
```
|
||||
GET _cat/indices?v
|
||||
```
|
||||
|
||||
To limit the information to a specific index, add the index name after your query.
|
||||
|
||||
```
|
||||
GET _cat/indices/<index>?v
|
||||
```
|
||||
|
||||
## Master
|
||||
|
||||
Lists information that helps identify the elected master node.
|
||||
|
||||
```
|
||||
GET _cat/master?v
|
||||
```
|
||||
|
||||
## Node attributes
|
||||
|
||||
Lists the attributes of custom nodes.
|
||||
|
||||
```
|
||||
GET _cat/nodeattrs?v
|
||||
```
|
||||
|
||||
## Nodes
|
||||
|
||||
Lists node-level information, including node roles and load metrics.
|
||||
|
||||
A few important node metrics are `pid`, `name`, `master`, `ip`, `port`, `version`, `build`, `jdk`, along with `disk`, `heap`, `ram`, and `file_desc`.
|
||||
|
||||
```
|
||||
GET _cat/nodes?v
|
||||
```
|
||||
|
||||
## Pending tasks
|
||||
|
||||
Lists the progress of all pending tasks, including task priority and time in queue.
|
||||
|
||||
```
|
||||
GET _cat/pending_tasks?v
|
||||
```
|
||||
|
||||
## Plugins
|
||||
|
||||
Lists the names, components, and versions of the installed plugins.
|
||||
|
||||
```
|
||||
GET _cat/plugins?v
|
||||
```
|
||||
|
||||
## Recovery
|
||||
|
||||
Lists all completed and ongoing index and shard recoveries.
|
||||
|
||||
```
|
||||
GET _cat/recovery?v
|
||||
```
|
||||
|
||||
To see only the recoveries of a specific index, add the index name after your query.
|
||||
|
||||
```
|
||||
GET _cat/recovery/<index>?v
|
||||
```
|
||||
|
||||
## Repositories
|
||||
|
||||
Lists all snapshot repositories and their types.
|
||||
|
||||
```
|
||||
GET _cat/repositories?v
|
||||
```
|
||||
|
||||
## Segments
|
||||
|
||||
Lists Lucene segment-level information for each index.
|
||||
|
||||
```
|
||||
GET _cat/segments?v
|
||||
```
|
||||
|
||||
To see only the information about segments of a specific index, add the index name after your query.
|
||||
|
||||
```
|
||||
GET _cat/segments/<index>?v
|
||||
```
|
||||
|
||||
## Shards
|
||||
|
||||
Lists the state of all primary and replica shards and how they are distributed.
|
||||
|
||||
```
|
||||
GET _cat/shards?v
|
||||
```
|
||||
|
||||
To see only the information about shards of a specific index, add the index name after your query.
|
||||
|
||||
```
|
||||
GET _cat/shards/<index>?v
|
||||
```
|
||||
|
||||
## Snapshots
|
||||
|
||||
Lists all snapshots for a repository.
|
||||
|
||||
```
|
||||
GET _cat/snapshots/<repository>?v
|
||||
```
|
||||
|
||||
## Tasks
|
||||
|
||||
Lists the progress of all tasks currently running on your cluster.
|
||||
|
||||
```
|
||||
GET _cat/tasks?v
|
||||
```
|
||||
|
||||
## Templates
|
||||
|
||||
Lists the names, patterns, order numbers, and version numbers of index templates.
|
||||
|
||||
```
|
||||
GET _cat/templates?v
|
||||
```
|
||||
|
||||
## Thread pool
|
||||
|
||||
Lists the active, queued, and rejected threads of different thread pools on each node.
|
||||
|
||||
```
|
||||
GET _cat/thread_pool?v
|
||||
```
|
||||
|
||||
To limit the information to a specific thread pool, add the thread pool name after your query.
|
||||
|
||||
```
|
||||
GET _cat/thread_pool/<thread_pool>?v
|
||||
```
|
||||
@@ -329,10 +329,4 @@ You can then use the [Index State Management (ISM)]({{site.url}}{{site.baseurl}}
|
||||
|
||||
## Next steps
|
||||
|
||||
If you are using the security plugin, the previous request to `_cat/nodes?v` might have failed with an initialization error. To initialize the plugin, run `opensearch/plugins/opensearch-security/tools/securityadmin.sh`. A sample command that uses the demo certificates might look like this:
|
||||
|
||||
```bash
|
||||
sudo ./securityadmin.sh -cd {{site.url}}{{site.baseurl}}/securityconfig/ -icl -nhnv -cacert /etc/opensearch/root-ca.pem -cert /etc/opensearch/kirk.pem -key /etc/opensearch/kirk-key.pem -h <private-ip>
|
||||
```
|
||||
|
||||
For full guidance around configuration options, see [Security configuration]({{site.url}}{{site.baseurl}}/security-plugin/configuration/index/).
|
||||
If you are using the security plugin, the previous request to `_cat/nodes?v` might have failed with an initialization error. For full guidance around using the security plugin, see [Security configuration]({{site.url}}{{site.baseurl}}/security-plugin/configuration/index/).
|
||||
|
||||
@@ -8,10 +8,10 @@ nav_order: 5
|
||||
|
||||
Most OpenSearch configuration can take place in the cluster settings API. Certain operations require you to modify `opensearch.yml` and restart the cluster.
|
||||
|
||||
Whenever possible, use the cluster settings API instead; `opensearch.yml` is local to each node, whereas the API applies the setting to all nodes in the cluster.
|
||||
Whenever possible, use the cluster settings API instead; `opensearch.yml` is local to each node, whereas the API applies the setting to all nodes in the cluster. Certain settings, however, require `opensearch.yml`. In general, these settings relate to networking, cluster formation, and the local file system. To learn more, see [Cluster formation]({{site.url}}{{site.baseurl}}/opensearch/cluster/).
|
||||
|
||||
|
||||
## Cluster settings API
|
||||
## Update cluster settings using the API
|
||||
|
||||
The first step in changing a setting is to view the current settings:
|
||||
|
||||
@@ -37,7 +37,7 @@ If you specify the same setting in multiple places, OpenSearch uses the followin
|
||||
To change a setting, just specify the new one as either persistent or transient. This example shows the flat settings form:
|
||||
|
||||
```json
|
||||
PUT /_cluster/settings
|
||||
PUT _cluster/settings
|
||||
{
|
||||
"persistent" : {
|
||||
"action.auto_create_index" : false
|
||||
@@ -48,7 +48,7 @@ PUT /_cluster/settings
|
||||
You can also use the expanded form, which lets you copy and paste from the GET response and change existing values:
|
||||
|
||||
```json
|
||||
PUT /_cluster/settings
|
||||
PUT _cluster/settings
|
||||
{
|
||||
"persistent": {
|
||||
"action": {
|
||||
@@ -63,6 +63,6 @@ PUT /_cluster/settings
|
||||
|
||||
## Configuration file
|
||||
|
||||
You can find `opensearch.yml` in `/usr/share/opensearch/config/opensearch.yml` (Docker) or `/etc/opensearch/opensearch.yml` (RPM and DEB) on each node.
|
||||
You can find `opensearch.yml` in `/usr/share/opensearch/config/opensearch.yml` (Docker) or `/etc/opensearch/opensearch.yml` (most Linux distributions) on each node.
|
||||
|
||||
The demo configuration includes a number of settings for the security plugin that you should modify before using OpenSearch for a production workload. To learn more, see [Security]({{site.url}}{{site.baseurl}}/security-plugin/).
|
||||
|
||||
@@ -0,0 +1,291 @@
|
||||
---
|
||||
layout: default
|
||||
title: Data streams
|
||||
nav_order: 13
|
||||
---
|
||||
|
||||
# Data streams
|
||||
|
||||
If you're ingesting continuously generated time-series data such as logs, events, and metrics into OpenSearch, you're likely in a scenario where the number of documents grows rapidly and you don't need to update older documents.
|
||||
|
||||
A typical workflow to manage time-series data involves multiple steps such as creating a rollover index alias, defining a write index, and defining common mappings and settings for the backing indices.
|
||||
|
||||
Data streams simplify this bootstrapping process and enforce a setup that best suits time-series data, such as being designed primarily for append-only data, and ensuring that each document has a timestamp field.
|
||||
|
||||
A data stream is internally composed of multiple backing indices. Search requests are routed to all the backing indices, while indexing requests are routed to the latest write index. You can use [ISM]({{site.url}}{{site.baseurl}}/im-plugin/ism/index/) policies to automatically handle rollovers or deletion of indices in a data stream, based on your use case.
|
||||
|
||||
|
||||
## About data streams
|
||||
|
||||
A data stream consists of one or more hidden auto-generated backing indices. These backing indices are named using the following convention:
|
||||
|
||||
```
|
||||
.ds-<data-stream-name>-<generation-id>
|
||||
```
|
||||
|
||||
For example, `.ds-logs-redis-000003`, where generation-id is a six-digit, zero-padded integer that acts as a cumulative count of the data stream’s rollovers, starting at `000001`.
|
||||
|
||||
The most recently created backing index is the data stream’s write index. You can’t add documents directly to any of the backing indices. You can only add them via the data stream handle:
|
||||
|
||||

|
||||
|
||||
The data stream routes search requests to all of its backing indices. It uses the timestamp field to intelligently route search requests to the right set of indices and shards:
|
||||
|
||||

|
||||
|
||||
The following operations are not supported on the write index because they might hinder the indexing operation:
|
||||
|
||||
- close
|
||||
- clone
|
||||
- delete
|
||||
- shrink
|
||||
- split
|
||||
|
||||
## Get started with data streams
|
||||
|
||||
### Step 1: Create an index template
|
||||
|
||||
To create a data stream, you first need to create an index template that configures a set of indices as a data stream. The `data_stream` object indicates that it’s a data stream and not a regular index template. The index pattern matches with the name of the data stream:
|
||||
|
||||
```json
|
||||
PUT _index_template/logs-template
|
||||
{
|
||||
"index_patterns": [
|
||||
"my-data-stream",
|
||||
"logs-*"
|
||||
],
|
||||
"data_stream": {},
|
||||
"priority": 100
|
||||
}
|
||||
```
|
||||
|
||||
In this case, each ingested document must have an `@timestamp` field.
|
||||
You also have the ability to define your own custom timestamp field as a property in the `data_stream` object. You can also add index mappings and other settings here, just as you would for a regular index template.
|
||||
|
||||
```json
|
||||
PUT _index_template/logs-template-nginx
|
||||
{
|
||||
"index_patterns": "logs-nginx",
|
||||
"data_stream": {
|
||||
"timestamp_field": {
|
||||
"name": "request_time"
|
||||
}
|
||||
},
|
||||
"priority": 200,
|
||||
"template": {
|
||||
"settings": {
|
||||
"number_of_shards": 1,
|
||||
"number_of_replicas": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
In this case, `logs-nginx` index matches both the `logs-template` and `logs-template-nginx` templates. When you have a tie, OpenSearch selects the matching index template with the higher priority value.
|
||||
|
||||
### Step 2: Create a data stream
|
||||
|
||||
After you create an index template, you can create a data stream.
|
||||
You can use the data stream API to explicitly create a data stream. The data stream API initializes the first backing index:
|
||||
|
||||
```json
|
||||
PUT _data_stream/logs-redis
|
||||
PUT _data_stream/logs-nginx
|
||||
```
|
||||
|
||||
You can also directly start ingesting data without creating a data stream.
|
||||
|
||||
Because we have a matching index template with a data_stream object, OpenSearch automatically creates the data stream:
|
||||
|
||||
```json
|
||||
POST logs-staging/_doc
|
||||
{
|
||||
"message": "login attempt failed",
|
||||
"@timestamp": "2013-03-01T00:00:00"
|
||||
}
|
||||
```
|
||||
|
||||
To see information about a specific data stream:
|
||||
|
||||
```json
|
||||
GET _data_stream/logs-nginx
|
||||
```
|
||||
|
||||
#### Sample response
|
||||
|
||||
```json
|
||||
{
|
||||
"data_streams" : [
|
||||
{
|
||||
"name" : "logs-nginx",
|
||||
"timestamp_field" : {
|
||||
"name" : "request_time"
|
||||
},
|
||||
"indices" : [
|
||||
{
|
||||
"index_name" : ".ds-logs-nginx-000001",
|
||||
"index_uuid" : "-VhmuhrQQ6ipYCmBhn6vLw"
|
||||
}
|
||||
],
|
||||
"generation" : 1,
|
||||
"status" : "GREEN",
|
||||
"template" : "logs-template-nginx"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
You can see the name of the timestamp field, the list of the backing indices, and the template that's used to create the data stream. You can also see the health of the data stream, which represents the lowest status of all its backing indices.
|
||||
|
||||
To see more insights about the data stream, use the `_stats` endpoint:
|
||||
|
||||
```json
|
||||
GET _data_stream/logs-nginx/_stats
|
||||
```
|
||||
|
||||
#### Sample response
|
||||
|
||||
```json
|
||||
{
|
||||
"_shards" : {
|
||||
"total" : 1,
|
||||
"successful" : 1,
|
||||
"failed" : 0
|
||||
},
|
||||
"data_stream_count" : 1,
|
||||
"backing_indices" : 1,
|
||||
"total_store_size_bytes" : 208,
|
||||
"data_streams" : [
|
||||
{
|
||||
"data_stream" : "logs-nginx",
|
||||
"backing_indices" : 1,
|
||||
"store_size_bytes" : 208,
|
||||
"maximum_timestamp" : 0
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Step 3: Ingest data into the data stream
|
||||
|
||||
To ingest data into a data stream, you can use the regular indexing APIs. Make sure every document that you index has a timestamp field. If you try to ingest a document that doesn't have a timestamp field, you get an error.
|
||||
|
||||
```json
|
||||
POST logs-redis/_doc
|
||||
{
|
||||
"message": "login attempt",
|
||||
"@timestamp": "2013-03-01T00:00:00"
|
||||
}
|
||||
```
|
||||
|
||||
### Step 4: Searching a data stream
|
||||
|
||||
You can search a data stream just like you search a regular index or an index alias.
|
||||
The search operation applies to all of the backing indices (all data present in the stream).
|
||||
|
||||
```json
|
||||
GET logs-redis/_search
|
||||
{
|
||||
"query": {
|
||||
"match": {
|
||||
"message": "login"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Sample response
|
||||
|
||||
```json
|
||||
{
|
||||
"took" : 514,
|
||||
"timed_out" : false,
|
||||
"_shards" : {
|
||||
"total" : 5,
|
||||
"successful" : 5,
|
||||
"skipped" : 0,
|
||||
"failed" : 0
|
||||
},
|
||||
"hits" : {
|
||||
"total" : {
|
||||
"value" : 1,
|
||||
"relation" : "eq"
|
||||
},
|
||||
"max_score" : 0.2876821,
|
||||
"hits" : [
|
||||
{
|
||||
"_index" : ".ds-logs-redis-000001",
|
||||
"_type" : "_doc",
|
||||
"_id" : "-rhVmXoBL6BAVWH3mMpC",
|
||||
"_score" : 0.2876821,
|
||||
"_source" : {
|
||||
"message" : "login attempt",
|
||||
"@timestamp" : "2013-03-01T00:00:00"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Step 5: Rollover a data stream
|
||||
|
||||
A rollover operation creates a new backing index that becomes the data stream’s new write index.
|
||||
|
||||
To perform manual rollover operation on the data stream:
|
||||
|
||||
```json
|
||||
POST logs-redis/_rollover
|
||||
```
|
||||
|
||||
#### Sample response
|
||||
|
||||
```json
|
||||
{
|
||||
"acknowledged" : true,
|
||||
"shards_acknowledged" : true,
|
||||
"old_index" : ".ds-logs-redis-000001",
|
||||
"new_index" : ".ds-logs-redis-000002",
|
||||
"rolled_over" : true,
|
||||
"dry_run" : false,
|
||||
"conditions" : { }
|
||||
}
|
||||
```
|
||||
|
||||
If you now perform a `GET` operation on the `logs-redis` data stream, you see that the generation ID is incremented from 1 to 2.
|
||||
|
||||
You can also set up an [Index State Management (ISM) policy]({{site.url}}{{site.baseurl}}/im-plugin/ism/policies/) to automate the rollover process for the data stream.
|
||||
The ISM policy is applied to the backing indices at the time of their creation. When you associate a policy to a data stream, it only affects the future backing indices of that data stream.
|
||||
|
||||
You also don’t need to provide the `rollover_alias` setting, because the ISM policy infers this information from the backing index.
|
||||
|
||||
### Step 6: Manage data streams in OpenSearch Dashboards
|
||||
|
||||
To manage data streams from OpenSearch Dashboards, open **OpenSearch Dashboards**, choose **Index Management**, select **Indices** or **Policy managed indices**.
|
||||
|
||||
You see a toggle switch for data streams that you can use to show or hide indices belonging to a data stream.
|
||||
|
||||
When you enable this switch, you see a data stream multi-select dropdown menu that you can use for filtering data streams.
|
||||
You also see a data stream column that shows you the name of the data stream the index is contained in.
|
||||
|
||||

|
||||
|
||||
You can select one or more data streams and apply an ISM policy on them. You can also apply a policy on any individual backing index.
|
||||
|
||||
You can performing visualizations on a data stream just like you would on a regular index or index alias.
|
||||
|
||||
### Step 7: Delete a data stream
|
||||
|
||||
The delete operation first deletes the backing indices of a data stream and then deletes the data stream itself.
|
||||
|
||||
To delete a data stream and all of its hidden backing indices:
|
||||
|
||||
```json
|
||||
DELETE _data_stream/<name_of_data_stream>
|
||||
```
|
||||
|
||||
You can use wildcards to delete more than one data stream.
|
||||
|
||||
We recommend deleting data from a data stream using an ISM policy.
|
||||
|
||||
You can also use [asynchronous search]({{site.url}}{{site.baseurl}}/search-plugins/async/index/) and [SQL]({{site.url}}{{site.baseurl}}/search-plugins/sql/index/) and [PPL]({{site.url}}{{site.baseurl}}/search-plugins/ppl/index/) to query your data stream directly. You can also use the security plugin to define granular permissions on the data stream name.
|
||||
@@ -0,0 +1,60 @@
|
||||
---
|
||||
layout: default
|
||||
title: Date math support for index names
|
||||
nav_order: 92
|
||||
---
|
||||
|
||||
# Date math support for index names
|
||||
|
||||
Date math is shorthand arithmetic for finding relative dates.
|
||||
|
||||
If you're indexing time-series data with the dates mapped in the index names, you can use date math in your queries to filter index names and limit the number of searched indices.
|
||||
|
||||
## Date math syntax
|
||||
|
||||
The date math syntax for an index name is as follows:
|
||||
|
||||
```
|
||||
<static_name{date_math_expr{date_format|time_zone}}>
|
||||
```
|
||||
|
||||
- `static_name`: The unchanged or static portion of the index name. To use the characters `{` and `}` in the static part of an index name, escape them with a backslash `\`.
|
||||
- `date_math_expr`: The changing or dynamic portion of the index name that’s computed by the date math expression. For example, `now+1h` adds one hour, `now-1d` subtracts one hour, and `now/d` rounds down to the nearest day, where `now` represents the current timestamp.
|
||||
- `date_format`: (Optional) Specify the format for the computed date. The default value is `YYYY.MM.dd`. Make sure that you’re using the correct small or capital letters in the date format. For example, `mm` denotes minute of hour, while `MM` denotes month of year. Similarly, `hh` denotes the hour in the `1-12` range in combination with AM/PM, while `HH` denotes the hour in the `0-23` 24-hour range.
|
||||
- `time_zone`: (Optional) Specify the timezone offset. The default value is UTC. For example, the UTC time offset for PST is `-08:00`.
|
||||
|
||||
## Date math example
|
||||
|
||||
You must enclose date math index names within angle brackets.
|
||||
|
||||
If today is 22nd March, 2024:
|
||||
|
||||
- `<logstash-{now/d}>` resolves to `logstash-2024.03.22`
|
||||
- `<logstash-{now/M}>` resolves to `logstash-2024.03.01`
|
||||
- `<logstash-{now/M{YYYY.MM}}>` resolves to `logstash-2024.03`
|
||||
- `<logstash-{now/M-1M{YYYY.MM}}>` resolves to `logstash-2024.02`
|
||||
- `<logstash-{now/d{yyyy.MM.dd|+12:00}}>` resolves to `logstash-2024.03.23`
|
||||
|
||||
You need to encode all special characters in URI format:
|
||||
|
||||
Special characters | URI format
|
||||
:--- | :---
|
||||
`<` | %3C
|
||||
`>` | %3E
|
||||
`/` | %2F
|
||||
`{` | %7B
|
||||
`}` | %7D
|
||||
`|` | %7C
|
||||
`+` | %2B
|
||||
`:` | %3A
|
||||
`,` | %2C
|
||||
`\` | %5C
|
||||
|
||||
If you are searching for errors in your daily logs with the default Logstash index name format `logstash-YYYY.MM.dd`, you can use date math to restrict the search to indices of the past three days:
|
||||
|
||||
```
|
||||
# GET <logstash-{now/d-2d}>,<logstash-{now/d-1d}>,<logstash-{now/d}>/_search
|
||||
GET %3Clogstash-%7Bnow%2Fd-2d%7D%3E%2C%3Clogstash-%7Bnow%2Fd-1d%7D%3E%2C%3Clogstash-%7Bnow%2Fd%7D%3E/_search
|
||||
```
|
||||
|
||||
This date math expression is evaluated at runtime.
|
||||
+221
-16
@@ -1,23 +1,14 @@
|
||||
---
|
||||
layout: default
|
||||
title: Index templates
|
||||
nav_order: 14
|
||||
nav_order: 15
|
||||
---
|
||||
|
||||
# Index templates
|
||||
|
||||
Index templates let you initialize new indices with predefined mappings and settings. For example, if you continuously index log data, you can define an index template so that all of these indices have the same number of shards and replicas.
|
||||
|
||||
---
|
||||
|
||||
#### Table of contents
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Create a template
|
||||
### Create a template
|
||||
|
||||
To create an index template, use a POST request:
|
||||
|
||||
@@ -106,7 +97,7 @@ GET logs-2020-01-01
|
||||
|
||||
Any additional indices that match this pattern---`logs-2020-01-02`, `logs-2020-01-03`, and so on---will inherit the same mappings and settings.
|
||||
|
||||
## Retrieve a template
|
||||
### Retrieve a template
|
||||
|
||||
To list all index templates:
|
||||
|
||||
@@ -138,7 +129,7 @@ To check if a specific template exists:
|
||||
HEAD _index_template/<name>
|
||||
```
|
||||
|
||||
## Configure multiple templates
|
||||
### Configure multiple templates
|
||||
|
||||
You can create multiple index templates for your indices. If the index name matches more than one template, OpenSearch merges all mappings and settings from all matching templates and applies them to the index.
|
||||
|
||||
@@ -184,7 +175,7 @@ PUT _index_template/template-02
|
||||
|
||||
Because `template-02` has a higher `priority` value, it takes precedence over `template-01` . The `logs-2020-01-02` index would have the `number_of_shards` value as 3.
|
||||
|
||||
## Delete a template
|
||||
### Delete a template
|
||||
|
||||
You can delete an index template using its name:
|
||||
|
||||
@@ -192,11 +183,225 @@ You can delete an index template using its name:
|
||||
DELETE _index_template/daily_logs
|
||||
```
|
||||
|
||||
## Composable index templates
|
||||
|
||||
Managing multiple index templates has the following challenges:
|
||||
|
||||
- If you have duplication between index templates, storing these index templates results in a bigger cluster state.
|
||||
- If you want to make a change across all your index templates, you have to manually make the change for each template.
|
||||
- If an index matches multiple templates, OpenSearch might merge the templates in an unexpected way that you discover only after an index is created.
|
||||
|
||||
You can use composable index templates to overcome these challenges. Composable index templates let you abstract common settings, mappings, and aliases into a reusable building block called a component template.
|
||||
|
||||
You can combine component templates to compose an index template.
|
||||
|
||||
Settings and mappings that you specify directly in the [create index]({{site.url}}{{site.baseurl}}/opensearch/rest-api/create-index/) request override any settings or mappings specified in an index template and its component templates.
|
||||
{: .note }
|
||||
|
||||
### Create a component template
|
||||
|
||||
Let's define two component templates---`component_template_1` and `component_template_2`:
|
||||
|
||||
#### Component template 1
|
||||
|
||||
```json
|
||||
PUT _component_template/component_template_1
|
||||
{
|
||||
"template": {
|
||||
"mappings": {
|
||||
"properties": {
|
||||
"@timestamp": {
|
||||
"type": "date"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Component template 2
|
||||
|
||||
```json
|
||||
PUT _component_template/component_template_2
|
||||
{
|
||||
"template": {
|
||||
"mappings": {
|
||||
"properties": {
|
||||
"ip_address": {
|
||||
"type": "ip"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Use component templates to create an index template
|
||||
|
||||
When creating index templates, you need to include the component templates in a `composed_of` list.
|
||||
|
||||
OpenSearch applies the component templates in the order in which you specify them within the index template. The settings, mappings, and aliases that you specify inside the index template are applied last.
|
||||
|
||||
```json
|
||||
PUT _index_template/daily_logs
|
||||
{
|
||||
"index_patterns": [
|
||||
"logs-2020-01-*"
|
||||
],
|
||||
"template": {
|
||||
"aliases": {
|
||||
"my_logs": {}
|
||||
},
|
||||
"settings": {
|
||||
"number_of_shards": 2,
|
||||
"number_of_replicas": 1
|
||||
},
|
||||
"mappings": {
|
||||
"properties": {
|
||||
"timestamp": {
|
||||
"type": "date",
|
||||
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
|
||||
},
|
||||
"value": {
|
||||
"type": "double"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"priority": 200,
|
||||
"composed_of": [
|
||||
"component_template_1",
|
||||
"component_template_2"
|
||||
],
|
||||
"version": 3,
|
||||
"_meta": {
|
||||
"description": "using component templates"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If you create an index named `logs-2020-01-01`, you can see that it derives its mappings and settings from both the component templates:
|
||||
|
||||
```json
|
||||
PUT logs-2020-01-01
|
||||
GET logs-2020-01-01
|
||||
```
|
||||
|
||||
#### Sample response
|
||||
|
||||
```json
|
||||
{
|
||||
"logs-2020-01-01": {
|
||||
"aliases": {
|
||||
"my_logs": {}
|
||||
},
|
||||
"mappings": {
|
||||
"properties": {
|
||||
"@timestamp": {
|
||||
"type": "date"
|
||||
},
|
||||
"ip_address": {
|
||||
"type": "ip"
|
||||
},
|
||||
"timestamp": {
|
||||
"type": "date",
|
||||
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
|
||||
},
|
||||
"value": {
|
||||
"type": "double"
|
||||
}
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"index": {
|
||||
"creation_date": "1625382479459",
|
||||
"number_of_shards": "2",
|
||||
"number_of_replicas": "1",
|
||||
"uuid": "rYUlpOXDSUSuZifQLPfa5A",
|
||||
"version": {
|
||||
"created": "7100299"
|
||||
},
|
||||
"provided_name": "logs-2020-01-01"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Simulate multi-component templates
|
||||
|
||||
For index templates composed of multiple component templates, you can simulate applying a new template to verify whether the settings are applied as you expect.
|
||||
|
||||
To simulate the settings that would be applied to a specific index name:
|
||||
|
||||
```json
|
||||
POST _index_template/_simulate_index/<index_name>
|
||||
```
|
||||
|
||||
To simulate the settings that would be applied from an existing template:
|
||||
|
||||
```json
|
||||
POST _index_template/_simulate/<index_template>
|
||||
```
|
||||
|
||||
You can also specify a template definition in the simulate request:
|
||||
|
||||
```json
|
||||
POST _index_template/_simulate
|
||||
{
|
||||
"index_patterns": [
|
||||
"logs-2020-01-*"
|
||||
],
|
||||
"template": {
|
||||
"settings" : {
|
||||
"index.number_of_shards" : 3
|
||||
}
|
||||
},
|
||||
"composed_of": ["component_template_1", "component_template_2"]
|
||||
}
|
||||
```
|
||||
|
||||
The `_simulate` API returns the final settings, mappings, and aliases that will be applied to indices that match the index pattern. You can also see any overlapping templates whose configuration is superseded by the simulated template body or higher priority templates:
|
||||
|
||||
```json
|
||||
{
|
||||
"template" : {
|
||||
"settings" : {
|
||||
"index" : {
|
||||
"number_of_shards" : "3"
|
||||
}
|
||||
},
|
||||
"mappings" : {
|
||||
"properties" : {
|
||||
"@timestamp" : {
|
||||
"type" : "date"
|
||||
},
|
||||
"ip_address" : {
|
||||
"type" : "ip"
|
||||
}
|
||||
}
|
||||
},
|
||||
"aliases" : { }
|
||||
},
|
||||
"overlapping" : [
|
||||
{
|
||||
"name" : "daily_logs",
|
||||
"index_patterns" : [
|
||||
"logs-2020-01-*"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Index template options
|
||||
|
||||
You can specify the following template options:
|
||||
|
||||
Option | Type | Description | Required
|
||||
:--- | :--- | :--- | :---
|
||||
`priority` | `Number` | The priority of the index template. | No
|
||||
`create` | `Boolean` | Whether this index template should replace an existing one. | No
|
||||
`template` | `Object` | Specify index settings, mappings, and aliases. | No
|
||||
`priority` | `Integer` | The priority of the index template. | No
|
||||
`composed_of` | `String array` | The names of component templates applied on a new index together with the current template. | No
|
||||
`version` | `Integer` | Specify a version number to simplify template management. Default is `null`. | No
|
||||
`_meta ` | `Object` | Specify meta information about the template. | No
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
layout: default
|
||||
title: Compatibility
|
||||
parent: Install OpenSearch
|
||||
nav_order: 2
|
||||
---
|
||||
|
||||
# Operating system and JVM compatibility
|
||||
|
||||
- We recommend installing OpenSearch on RHEL- or Debian-based Linux distributions that use [systemd](https://en.wikipedia.org/wiki/Systemd), such as CentOS, Amazon Linux 2, and Ubuntu (LTS). OpenSearch should work on many Linux distributions, but we only test a handful.
|
||||
- The OpenSearch tarball ships with a compatible version of Java in the `jdk` directory. To find its version, run `./jdk/bin/java -version`. For example, the OpenSearch 1.0.0 tarball ships with Java 15 (non-LTS).
|
||||
|
||||
{% comment %}`./jdk/bin/java -version` doesn't work on macOS with zsh at the moment, and I have no idea why. Maybe we need a macOS artifact. Regardless, the command works on Amazon Linux 2 with bash and presumably other distros. - aetter{% endcomment %}
|
||||
|
||||
To use a different Java installation, set the `OPENSEARCH_JAVA_HOME` environment variable to the Java install location. We recommend Java 11 (LTS), but OpenSearch also works with Java 8.
|
||||
|
||||
OpenSearch version | Compatible Java versions | Recommended operating systems
|
||||
:--- | :--- | :---
|
||||
1.x | 8, 11 | Red Hat Enterprise Linux 7, 8; CentOS 7, 8; Amazon Linux 2; Ubuntu 16.04, 18.04, 20.04
|
||||
@@ -7,10 +7,11 @@ nav_order: 5
|
||||
|
||||
# Docker security configuration
|
||||
|
||||
Before deploying to a production environment, you should replace the demo security certificates and configuration YAML files with your own. With the tarball, you have direct access to the file system, but the Docker image requires modifying the Docker storage volumes include the replacement files.
|
||||
Before deploying to a production environment, you should replace the demo security certificates and configuration YAML files with your own. With the tarball, you have direct access to the file system, but the Docker image requires modifying the Docker storage volumes to include the replacement files.
|
||||
|
||||
Additionally, you can set the Docker environment variable `DISABLE_INSTALL_DEMO_CONFIG` to `true`. This change completely disables the demo installer.
|
||||
|
||||
|
||||
## Sample Docker Compose file
|
||||
|
||||
```yml
|
||||
@@ -93,8 +94,7 @@ services:
|
||||
expose:
|
||||
- "5601"
|
||||
environment:
|
||||
OPENSEARCH_URL: https://opensearch-node1:9200
|
||||
OPENSEARCH_HOSTS: https://opensearch-node1:9200
|
||||
OPENSEARCH_HOSTS: '["https://opensearch-node1:9200","https://opensearch-node2:9200"]' # must be a string with no spaces when specified as an environment variable
|
||||
volumes:
|
||||
- ./custom-opensearch_dashboards.yml:/usr/share/opensearch-dashboards/config/opensearch_dashboards.yml
|
||||
networks:
|
||||
@@ -142,6 +142,7 @@ If you encounter any `File /usr/share/opensearch/config/opensearch.yml has insec
|
||||
|
||||
Finally, you can reach OpenSearch Dashboards at http://localhost:5601, sign in, and use the **Security** panel to perform other management tasks.
|
||||
|
||||
|
||||
## Using certificates with Docker
|
||||
|
||||
To use your own certificates in your configuration, add all of the necessary certificates to the volumes section of the Docker Compose file:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
layout: default
|
||||
title: Docker
|
||||
parent: Install OpenSearch
|
||||
nav_order: 1
|
||||
nav_order: 3
|
||||
---
|
||||
|
||||
# Docker image
|
||||
@@ -16,7 +16,7 @@ docker pull opensearchproject/opensearch-dashboards:{{site.opensearch_version}}
|
||||
|
||||
To check available versions, see [Docker Hub](https://hub.docker.com/u/opensearchproject).
|
||||
|
||||
OpenSearch images use `centos:7` as the base image. If you run Docker locally, we recommend allowing Docker to use at least 4 GB of RAM in **Preferences** > **Resources**.
|
||||
OpenSearch images use `amazonlinux:2` as the base image. If you run Docker locally, set Docker to use at least 4 GB of RAM in **Preferences** > **Resources**.
|
||||
|
||||
|
||||
---
|
||||
@@ -138,7 +138,7 @@ services:
|
||||
expose:
|
||||
- "5601"
|
||||
environment:
|
||||
OPENSEARCH_HOSTS: https://opensearch-node1:9200
|
||||
OPENSEARCH_HOSTS: '["https://opensearch-node1:9200","https://opensearch-node2:9200"]' # must be a string with no spaces when specified as an environment variable
|
||||
networks:
|
||||
- opensearch-net
|
||||
|
||||
@@ -150,7 +150,7 @@ networks:
|
||||
opensearch-net:
|
||||
```
|
||||
|
||||
If you override `opensearch_dashboards.yml` settings using environment variables, as seen above, use all uppercase letters and periods in place of underscores (e.g. for `opensearch.url`, specify `OPENSEARCH_URL`).
|
||||
If you override `opensearch_dashboards.yml` settings using environment variables, as seen above, use all uppercase letters and periods in place of underscores (e.g. for `opensearch.hosts`, use `OPENSEARCH_HOSTS`).
|
||||
{: .note}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
---
|
||||
layout: default
|
||||
title: Helm
|
||||
parent: Install OpenSearch
|
||||
nav_order: 6
|
||||
---
|
||||
|
||||
# Run OpenSearch using Helm
|
||||
|
||||
Helm is a package manager that allows you to easily install and manage OpenSearch in a Kubernetes cluster. You can define your OpenSearch configurations in a YAML file and use Helm to deploy your applications in a version-controlled and reproducible way.
|
||||
|
||||
The Helm chart contains the resources described in the following table.
|
||||
|
||||
Resource | Description
|
||||
:--- | :---
|
||||
`Chart.yaml` | Information about the chart.
|
||||
`values.yaml` | Default configuration values for the chart.
|
||||
`templates` | Templates that combine with values to generate the Kubernetes manifest files.
|
||||
|
||||
The specification in the default Helm chart supports many standard use cases and setups. You can modify the default chart to configure your desired specifications and set Transport Layer Security (TLS) and role-based access control (RBAC).
|
||||
|
||||
For information about the default configuration, steps to configure security, and configurable parameters, see the
|
||||
[README](https://github.com/opensearch-project/opensearch-devops/blob/main/Helm/README.md).
|
||||
|
||||
The instructions here assume you have a Kubernetes cluster with Helm preinstalled. See the [Kubernetes documentation](https://kubernetes.io/docs/setup/) for steps to configure a Kubernetes cluster and the [Helm documentation](https://helm.sh/docs/intro/install/) to install Helm.
|
||||
{: .note }
|
||||
|
||||
## Prerequisites
|
||||
|
||||
The default Helm chart deploys a three-node cluster. We recommend that you have at least 8 GiB of memory available for this deployment. You can expect the deployment to fail if, say, you have less than 4 GiB of memory available.
|
||||
|
||||
## Install OpenSearch using Helm
|
||||
|
||||
1. Clone the [opensearch-devops](https://github.com/opensearch-project/opensearch-devops/) repository:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/opensearch-project/opensearch-devops.git
|
||||
```
|
||||
|
||||
1. Change to the `opensearch` directory:
|
||||
|
||||
```bash
|
||||
cd Helm/opensearch
|
||||
```
|
||||
|
||||
1. Package the Helm chart:
|
||||
|
||||
```bash
|
||||
helm package .
|
||||
```
|
||||
|
||||
1. Deploy OpenSearch:
|
||||
|
||||
```bash
|
||||
helm install --generate-name opensearch-1.0.0.tgz
|
||||
```
|
||||
The output shows you the specifications instantiated from the install.
|
||||
To customize the deployment, pass in the values that you want to override with a custom YAML file:
|
||||
|
||||
```bash
|
||||
helm install --values=customvalues.yaml opensearch-1.0.0.tgz
|
||||
```
|
||||
|
||||
#### Sample output
|
||||
|
||||
```yaml
|
||||
NAME: opensearch-1-1629223146
|
||||
LAST DEPLOYED: Tue Aug 17 17:59:07 2021
|
||||
NAMESPACE: default
|
||||
STATUS: deployed
|
||||
REVISION: 1
|
||||
TEST SUITE: None
|
||||
NOTES:
|
||||
Watch all cluster members come up.
|
||||
$ kubectl get pods --namespace=default -l app=opensearch-cluster-master -w
|
||||
```
|
||||
|
||||
To make sure your OpenSearch pod is up and running, run the following command:
|
||||
|
||||
```bash
|
||||
$ kubectl get pods
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
opensearch-cluster-master-0 1/1 Running 0 3m56s
|
||||
opensearch-cluster-master-1 1/1 Running 0 3m56s
|
||||
opensearch-cluster-master-2 1/1 Running 0 3m56s
|
||||
```
|
||||
|
||||
To access the OpenSearch shell:
|
||||
|
||||
```bash
|
||||
$ kubectl exec -it opensearch-cluster-master-0 -- /bin/bash
|
||||
```
|
||||
|
||||
You can send requests to the pod to verify that OpenSearch is up and running:
|
||||
|
||||
```json
|
||||
$ curl -XGET https://localhost:9200 -u 'admin:admin' --insecure
|
||||
{
|
||||
"name" : "opensearch-cluster-master-1",
|
||||
"cluster_name" : "opensearch-cluster",
|
||||
"cluster_uuid" : "hP2gq5bPS3SLp8Z7wXm8YQ",
|
||||
"version" : {
|
||||
"distribution" : "opensearch",
|
||||
"number" : "1.0.0",
|
||||
"build_type" : "tar",
|
||||
"build_hash" : "34550c5b17124ddc59458ef774f6b43a086522e3",
|
||||
"build_date" : "2021-07-02T23:22:21.383695Z",
|
||||
"build_snapshot" : false,
|
||||
"lucene_version" : "8.8.2",
|
||||
"minimum_wire_compatibility_version" : "6.8.0",
|
||||
"minimum_index_compatibility_version" : "6.0.0-beta1"
|
||||
},
|
||||
"tagline" : "The OpenSearch Project: https://opensearch.org/"
|
||||
}
|
||||
```
|
||||
|
||||
## Uninstall using Helm
|
||||
|
||||
To identify the OpenSearch deployment that you want to delete:
|
||||
|
||||
```bash
|
||||
$ helm list
|
||||
NAME NAMESPACEREVISIONUPDATED STATUS CHART APP VERSION
|
||||
opensearch-1-1629223146 default 1 2021-08-17 17:59:07.664498239 +0000 UTCdeployedopensearch-1.0.0 1.0.0
|
||||
```
|
||||
|
||||
To delete or uninstall a deployment, run the following command:
|
||||
|
||||
```bash
|
||||
helm delete opensearch-1-1629223146
|
||||
```
|
||||
|
||||
For steps to install OpenSearch Dashboards, see [Helm to install OpenSearch Dashboards]({{site.url}}{{site.baseurl}}/dashboards/install/helm/).
|
||||
@@ -7,13 +7,13 @@ nav_order: 70
|
||||
|
||||
# Important settings
|
||||
|
||||
For production workloads, make sure the [Linux setting](https://www.kernel.org/doc/Documentation/sysctl/vm.txt) `vm.max_map_count` is set to at least 262144. On the OpenSearch Docker image, this setting is the default. To check, start a Bash session in the container and run:
|
||||
For production workloads, make sure the [Linux setting](https://www.kernel.org/doc/Documentation/sysctl/vm.txt) `vm.max_map_count` is set to at least 262144. Even if you use the Docker image, set this value on the *host machine*. To check the current value, run this command:
|
||||
|
||||
```bash
|
||||
cat /proc/sys/vm/max_map_count
|
||||
```
|
||||
|
||||
To increase this value, you have to modify the Docker image. For other install types, add this setting to the host machine's `/etc/sysctl.conf` file with the following line:
|
||||
To increase the value, add the following line to `/etc/sysctl.conf`:
|
||||
|
||||
```
|
||||
vm.max_map_count=262144
|
||||
|
||||
@@ -3,7 +3,6 @@ layout: default
|
||||
title: Install OpenSearch
|
||||
nav_order: 2
|
||||
redirect_from:
|
||||
- /docs/install/
|
||||
- /opensearch/install/
|
||||
has_children: true
|
||||
---
|
||||
|
||||
@@ -29,6 +29,23 @@ If you don't want to use the all-in-one OpenSearch installation options, you can
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>1.0.0</td>
|
||||
<td>
|
||||
<pre>opensearch-alerting 1.0.0.0
|
||||
opensearch-anomaly-detection 1.0.0.0
|
||||
opensearch-asynchronous-search 1.0.0.0
|
||||
opensearch-index-management 1.0.0.0
|
||||
opensearch-job-scheduler 1.0.0.0
|
||||
opensearch-knn 1.0.0.0
|
||||
opensearch-notebooks 1.0.0.0
|
||||
opensearch-performance-analyzer 1.0.0.0
|
||||
opensearch-reports-scheduler 1.0.0.0
|
||||
opensearch-security 1.0.0.0
|
||||
opensearch-sql 1.0.0.0
|
||||
</pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1.0.0-rc1</td>
|
||||
<td>
|
||||
|
||||
+2
-2
@@ -9,9 +9,9 @@ nav_order: 60
|
||||
The OpenSearch logs include valuable information for monitoring cluster operations and troubleshooting issues. The location of the logs differs based on the installation type:
|
||||
|
||||
- On Docker, OpenSearch writes most logs to the console and stores the remainder in `opensearch/logs/`. The tarball installation also uses `opensearch/logs/`.
|
||||
- On the RPM and Debian installations, OpenSearch writes logs to `/var/log/opensearch/`.
|
||||
- On most Linux installations, OpenSearch writes logs to `/var/log/opensearch/`.
|
||||
|
||||
Logs are available as `.log` (plain text) and `.json` files.
|
||||
Logs are available as `.log` (plain text) and `.json` files. Permissions for the OpenSearch logs are `-rw-r--r--` by default, meaning that any user account on the node can read them. You can change this behavior _for each log type_ in `log4j2.properties` using the `filePermissions` option. For example, you might add `appender.rolling.filePermissions = rw-r-----` to change permissions for the JSON server log. For details, see the [Log4j 2 documentation](https://logging.apache.org/log4j/2.x/manual/appenders.html#RollingFileAppender).
|
||||
|
||||
|
||||
## Application logs
|
||||
|
||||
@@ -6,7 +6,7 @@ nav_order: 96
|
||||
|
||||
# Popular APIs
|
||||
|
||||
This page contains sample requests for popular OpenSearch APIs.
|
||||
This page contains sample requests for popular OpenSearch operations.
|
||||
|
||||
|
||||
---
|
||||
@@ -80,7 +80,7 @@ POST _bulk
|
||||
## List all indices
|
||||
|
||||
```
|
||||
GET _cat/indices?v
|
||||
GET _cat/indices?v&expand_wildcards=all
|
||||
```
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ PUT _snapshot/my-repository/my-snapshot
|
||||
```json
|
||||
POST _snapshot/my-repository/my-snapshot/_restore
|
||||
{
|
||||
"indices": "-.opensearch_security",
|
||||
"indices": "-.opendistro_security",
|
||||
"include_global_state": false
|
||||
}
|
||||
```
|
||||
|
||||
@@ -3,7 +3,6 @@ layout: default
|
||||
title: Boolean queries
|
||||
parent: Query DSL
|
||||
nav_order: 45
|
||||
redirect_from: /docs/opensearch/bool/
|
||||
---
|
||||
|
||||
# Boolean queries
|
||||
|
||||
@@ -3,9 +3,6 @@ layout: default
|
||||
title: Full-text queries
|
||||
parent: Query DSL
|
||||
nav_order: 40
|
||||
redirect_from:
|
||||
- /docs/opensearch/full-text/
|
||||
- /opensearch/full-text/
|
||||
---
|
||||
|
||||
# Full-text queries
|
||||
|
||||
@@ -3,7 +3,6 @@ layout: default
|
||||
title: Term-level queries
|
||||
parent: Query DSL
|
||||
nav_order: 30
|
||||
redirect_from: /docs/opensearch/term/
|
||||
---
|
||||
|
||||
# Term-level queries
|
||||
@@ -145,7 +144,7 @@ The search query “To be, or not to be” is analyzed and tokenized into an arr
|
||||
...
|
||||
```
|
||||
|
||||
For a list of all full-text queries, see [Full-text queries]({{site.url}}{{site.baseurl}}/opensearch/full-text/).
|
||||
For a list of all full-text queries, see [Full-text queries]({{site.url}}{{site.baseurl}}/opensearch/query-dsl/full-text/).
|
||||
|
||||
If you want to query for an exact term like “HAMLET” in the speaker field and don't need the results to be sorted by relevance scores, a term-level query is more efficient:
|
||||
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
---
|
||||
layout: default
|
||||
title: Alias
|
||||
parent: REST API reference
|
||||
nav_order: 5
|
||||
---
|
||||
|
||||
# Alias
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
An alias is a virtual pointer that you can use to reference one or more indices. Creating and updating aliases are atomic operations, so you can reindex your data and point an alias at it without any downtime.
|
||||
|
||||
|
||||
## Example
|
||||
|
||||
```json
|
||||
POST _aliases
|
||||
{
|
||||
"actions": [
|
||||
{
|
||||
"add": {
|
||||
"index": "movies",
|
||||
"alias": "movies-alias1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"remove": {
|
||||
"index": "old-index",
|
||||
"alias": "old-index-alias"
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
POST _aliases
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All alias parameters are optional.
|
||||
|
||||
Parameter | Data Type | Description
|
||||
:--- | :--- | :---
|
||||
master_timeout | Time | The amount of time to wait for a response from the master node. Default is `30s`.
|
||||
timeout | Time | The amount of time to wait for a response from the cluster. Default is `30s`.
|
||||
|
||||
## Request body
|
||||
|
||||
In your request body, you need to specify what action to take, the alias name, and the index you want to associate with the alias. Other fields are optional.
|
||||
|
||||
Field | Data Type | Description | Required
|
||||
:--- | :--- | :--- | :---
|
||||
actions | Array | Set of actions you want to perform on the index. Valid options are: `add`, `remove`, and `remove_index`. You must have at least one action in the array. | Yes
|
||||
add | N/A | Adds an alias to the specified index. | No
|
||||
remove | N/A | Removes an alias from the specified index. | No
|
||||
remove_index | N/A | Deletes an index. | No
|
||||
index | String | Name of the index you want to associate with the alias. Supports wildcard expressions. | Yes if you don't supply an `indices` field in the body.
|
||||
indices | Array | Array of index names you want to associate with the alias. | Yes if you don't supply an `index` field in the body.
|
||||
alias | String | The name of the alias. | Yes if you don't supply an `aliases` field in the body.
|
||||
aliases | Array | Array of alias names. | Yes if you don't supply an `alias` field in the body.
|
||||
filter | Object | A filter to use with the alias, so the alias points to a filtered part of the index. | No
|
||||
is_hidden | Boolean | Specifies whether the alias should be hidden from results that include wildcard expressions | No
|
||||
must_exist | Boolean | Specifies whether the alias to remove must exist. | No
|
||||
is_write_index | Boolean | Specifies whether the index should be a write index. An alias can only have one write index at a time. | No
|
||||
routing | String | Used to assign a custom value to a shard for specific operations. | No
|
||||
index_routing | String | Assigns a custom value to a shard only for index operations. | No
|
||||
search_routing | String | Assigns a custom value to a shard only for search operations. | No
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
{
|
||||
"acknowledged": true
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,63 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat aliases
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 1
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat aliases
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The cat aliases operation lists the mapping of aliases to indices, plus routing and filtering information.
|
||||
|
||||
## Example
|
||||
|
||||
```json
|
||||
GET _cat/aliases?v
|
||||
```
|
||||
|
||||
To limit the information to a specific alias, add the alias name after your query:
|
||||
|
||||
```json
|
||||
GET _cat/aliases/<alias>?v
|
||||
```
|
||||
|
||||
If you want to get information for more than one alias, separate the alias names with commas:
|
||||
|
||||
```json
|
||||
GET _cat/aliases/alias1,alias2,alias3
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/aliases/<alias>
|
||||
GET _cat/aliases
|
||||
```
|
||||
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat aliases URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameters:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
local | Boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
expand_wildcards | Enum | Expands wildcard expressions to concrete indices. Combine multiple values with commas. Supported values are `all`, `open`, `closed`, `hidden`, and `none`. Default is `open`.
|
||||
|
||||
## Response
|
||||
|
||||
The following response shows that `alias1` refers to a `movies` index and has a configured filter:
|
||||
|
||||
```json
|
||||
alias | index | filter | routing.index | routing.search | is_write_index
|
||||
alias1 | movies | * | - | - | -
|
||||
.kibana | .kibana_1 | - | - | - | -
|
||||
```
|
||||
|
||||
To learn more about index aliases, see [Index aliases]({{site.url}}{{site.baseurl}}/opensearch/index-alias).
|
||||
@@ -0,0 +1,63 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat allocation
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 5
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat allocation
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The cat allocation operation lists the allocation of disk space for indices and the number of shards on each node.
|
||||
|
||||
## Example
|
||||
|
||||
```json
|
||||
GET _cat/allocation?v
|
||||
```
|
||||
|
||||
To limit the information to a specific node, add the node name after your query:
|
||||
|
||||
```json
|
||||
GET _cat/allocation/<node_name>
|
||||
```
|
||||
|
||||
If you want to get information for more than one node, separate the node names with commas:
|
||||
|
||||
```json
|
||||
GET _cat/aliases/node_name_1,node_name_2,node_name_3
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/allocation?v
|
||||
GET _cat/allocation/<node_name>
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat allocation URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameters:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
bytes | Byte size | Specify the units for byte size. For example, `7kb` or `6gb`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
local | Boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
The following response shows that 8 shards are allocated to each the two nodes available:
|
||||
|
||||
```json
|
||||
shards | disk.indices | disk.used | disk.avail | disk.total | disk.percent host | ip | node
|
||||
8 | 989.4kb | 25.9gb | 32.4gb | 58.4gb | 44 172.18.0.4 | 172.18.0.4 | odfe-node1
|
||||
8 | 962.4kb | 25.9gb | 32.4gb | 58.4gb | 44 172.18.0.3 | 172.18.0.3 | odfe-node2
|
||||
```
|
||||
@@ -0,0 +1,53 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat count
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 10
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat count
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The cat count operation lists the number of documents in your cluster.
|
||||
|
||||
## Example
|
||||
|
||||
```json
|
||||
GET _cat/count?v
|
||||
```
|
||||
|
||||
To see the number of documents in a specific index or alias, add the index or alias name after your query:
|
||||
|
||||
```json
|
||||
GET _cat/count/<index_or_alias>?v
|
||||
```
|
||||
|
||||
If you want to get information for more than one index or alias, separate the index or alias names with commas:
|
||||
|
||||
```json
|
||||
GET _cat/aliases/index_or_alias_1,index_or_alias_2,index_or_alias_3
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/count?v
|
||||
GET _cat/count/<index>?v
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat count URL parameters are optional. You can specify any of the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters).
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
The following response shows the overall document count as 1625:
|
||||
|
||||
```json
|
||||
epoch | timestamp | count
|
||||
1624237738 | 01:08:58 | 1625
|
||||
```
|
||||
@@ -0,0 +1,59 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat field data
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 15
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat fielddata
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The cat fielddata operation lists the memory size used by each field per node.
|
||||
|
||||
## Example
|
||||
|
||||
```json
|
||||
GET _cat/fielddata?v
|
||||
```
|
||||
|
||||
To limit the information to a specific field, add the field name after your query:
|
||||
|
||||
```json
|
||||
GET _cat/fielddata/<field_name>?v
|
||||
```
|
||||
|
||||
If you want to get information for more than one field, separate the field names with commas:
|
||||
|
||||
```json
|
||||
GET _cat/aliases/field_name_1,field_name_2,field_name_3
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/fielddata?v
|
||||
GET _cat/fielddata/<field_name>?v
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat fielddata URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameter:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
bytes | Byte size | Specify the units for byte size. For example, `7kb` or `6gb`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
|
||||
## Response
|
||||
|
||||
The following response shows the memory size for all fields as 284 bytes:
|
||||
|
||||
```json
|
||||
id host ip node field size
|
||||
1vo54NuxSxOrbPEYdkSF0w 172.18.0.4 172.18.0.4 odfe-node1 _id 284b
|
||||
ZaIkkUd4TEiAihqJGkp5CA 172.18.0.3 172.18.0.3 odfe-node2 _id 284b
|
||||
```
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat health
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 20
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat health
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The cat health operation lists the status of the cluster, how long the cluster has been up, the number of nodes, and other useful information that helps you analyze the health of your cluster.
|
||||
|
||||
## Example
|
||||
|
||||
```json
|
||||
GET _cat/health?v
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/health?v
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat health URL parameters are optional.
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
time | Time | Specify the units for time. For example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
ts | Boolean | If true, returns HH:MM:SS and Unix epoch timestamps. Default is true.
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
GET _cat/health?v&time=5d
|
||||
|
||||
epoch | timestamp | cluster | status | node.total | node.data | shards | pri | relo | init | unassign | pending_tasks | max_task_wait_time | active_shards_percent
|
||||
1624248112 | 04:01:52 | odfe-cluster | green | 2 | 2 | 16 | 8 | 0 | 0 | 0 | 0 | - | 100.0%
|
||||
```
|
||||
@@ -0,0 +1,63 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat indices
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 25
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat indices
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The cat indices operation lists information related to indices—how much disk space they are using, how many shards they have, their health status, and so on.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/indices?v
|
||||
```
|
||||
|
||||
To limit the information to a specific index, add the index name after your query.
|
||||
|
||||
```
|
||||
GET _cat/indices/<index>?v
|
||||
```
|
||||
|
||||
If you want to get information for more than one index, separate the indices with commas:
|
||||
|
||||
```json
|
||||
GET _cat/aliases/index1,index2,index3
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/indices/<index>
|
||||
GET _cat/indices
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat indices URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameters:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
bytes | Byte size | Specify the units for byte size. For example, `7kb` or `6gb`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
health | String | Limit indices based on their health status. Supported values are `green`, `yellow`, and `red`.
|
||||
include_unloaded_segments | Boolean | Whether to include information from segments not loaded into memory. Default is false.
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
pri | Boolean | Whether to return information only from the primary shards. Default is false.
|
||||
time | Time | Specify the units for time. For example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
expand_wildcards | Enum | Expands wildcard expressions to concrete indices. Combine multiple values with commas. Supported values are `all`, `open`, `closed`, `hidden`, and `none`. Default is `open`.
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
health | status | index | uuid | pri | rep | docs.count | docs.deleted | store.size | pri.store.size
|
||||
green | open | movies | UZbpfERBQ1-3GSH2bnM3sg | 1 | 1 | 1 | 0 | 7.7kb | 3.8kb
|
||||
```
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat master
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 30
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat master
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The cat master operation lists information that helps identify the elected master node.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/master?v
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/master
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat master URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameters:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
id | host | ip | node
|
||||
ZaIkkUd4TEiAihqJGkp5CA | 172.18.0.3 | 172.18.0.3 | odfe-node2
|
||||
```
|
||||
@@ -0,0 +1,45 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat nodeattrs
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 35
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat nodeattrs
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The cat nodeattrs operation lists the attributes of custom nodes.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/nodeattrs?v
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/nodeattrs
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat nodeattrs URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameters:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
local | Boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
node | host | ip | attr | value
|
||||
odfe-node2 | 172.18.0.3 | 172.18.0.3 | testattr | test
|
||||
```
|
||||
@@ -0,0 +1,52 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat nodes
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 40
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat nodes
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The cat nodes operation lists node-level information, including node roles and load metrics.
|
||||
|
||||
A few important node metrics are `pid`, `name`, `master`, `ip`, `port`, `version`, `build`, `jdk`, along with `disk`, `heap`, `ram`, and `file_desc`.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/nodes?v
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/nodes
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat nodes URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameters:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
bytes | Byte size | Specify the units for byte size. For example, `7kb` or `6gb`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
full_id | Boolean | If true, return the full node ID. If false, return the shortened node ID. Defaults to false.
|
||||
local | Boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
time | Time | Specify the units for time. For example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
include_unloaded_segments | Boolean | Whether to include information from segments not loaded into memory. Default is false.
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
ip | heap.percent | ram.percent | cpu load_1m | load_5m | load_15m | node.role | master | name
|
||||
172.18.0.3 | 31 | 97 | 3 | 0.03 | 0.10 | 0.14 dimr | * | odfe-node2
|
||||
172.18.0.4 | 45 | 97 | 3 | 0.19 | 0.14 | 0.15 dimr | - | odfe-node1
|
||||
```
|
||||
@@ -0,0 +1,46 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat pending tasks
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 45
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat pending tasks
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The cat pending tasks operation lists the progress of all pending tasks, including task priority and time in queue.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/pending_tasks?v
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/pending_tasks
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat nodes URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameters:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
local | Boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
time | Time | Specify the units for time. For example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
insertOrder | timeInQueue | priority | source
|
||||
1786 | 1.8s | URGENT | shard-started
|
||||
```
|
||||
@@ -0,0 +1,64 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat plugins
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 50
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat plugins
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The cat plugins operation lists the names, components, and versions of the installed plugins.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/plugins?v
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/plugins
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat plugins URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameters:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
local | Boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
name component version
|
||||
odfe-node2 opendistro-alerting 1.13.1.0
|
||||
odfe-node2 opendistro-anomaly-detection 1.13.0.0
|
||||
odfe-node2 opendistro-asynchronous-search 1.13.0.1
|
||||
odfe-node2 opendistro-index-management 1.13.2.0
|
||||
odfe-node2 opendistro-job-scheduler 1.13.0.0
|
||||
odfe-node2 opendistro-knn 1.13.0.0
|
||||
odfe-node2 opendistro-performance-analyzer 1.13.0.0
|
||||
odfe-node2 opendistro-reports-scheduler 1.13.0.0
|
||||
odfe-node2 opendistro-sql 1.13.2.0
|
||||
odfe-node2 opendistro_security 1.13.1.0
|
||||
odfe-node1 opendistro-alerting 1.13.1.0
|
||||
odfe-node1 opendistro-anomaly-detection 1.13.0.0
|
||||
odfe-node1 opendistro-asynchronous-search 1.13.0.1
|
||||
odfe-node1 opendistro-index-management 1.13.2.0
|
||||
odfe-node1 opendistro-job-scheduler 1.13.0.0
|
||||
odfe-node1 opendistro-knn 1.13.0.0
|
||||
odfe-node1 opendistro-performance-analyzer 1.13.0.0
|
||||
odfe-node1 opendistro-reports-scheduler 1.13.0.0
|
||||
odfe-node1 opendistro-sql 1.13.2.0
|
||||
odfe-node1 opendistro_security 1.13.1.0
|
||||
```
|
||||
@@ -0,0 +1,59 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat recovery
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 50
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat recovery
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The cat recovery operation lists all completed and ongoing index and shard recoveries.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/recovery?v
|
||||
```
|
||||
|
||||
To see only the recoveries of a specific index, add the index name after your query.
|
||||
|
||||
```
|
||||
GET _cat/recovery/<index>?v
|
||||
```
|
||||
|
||||
If you want to get information for more than one index, separate the indices with commas:
|
||||
|
||||
```json
|
||||
GET _cat/aliases/index1,index2,index3
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/recovery
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat recovery URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameters:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
active_only | Boolean | Whether to only include ongoing shard recoveries. Default is false.
|
||||
bytes | Byte size | Specify the units for byte size. For example, `7kb` or `6gb`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
detailed | Boolean | Whether to include detailed information about shard recoveries. Default is false.
|
||||
time | Time | Specify the units for time. For example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
index | shard | time | type | stage | source_host | source_node | target_host | target_node | repository | snapshot | files | files_recovered | files_percent | files_total | bytes | bytes_recovered | bytes_percent | bytes_total | translog_ops | translog_ops_recovered | translog_ops_percent
|
||||
movies | 0 | 117ms | empty_store | done | n/a | n/a | 172.18.0.4 | odfe-node1 | n/a | n/a | 0 | 0 | 0.0% | 0 | 0 | 0 | 0.0% | 0 | 0 | 0 | 100.0%
|
||||
movies | 0 | 382ms | peer | done | 172.18.0.4 | odfe-node1 | 172.18.0.3 | odfe-node2 | n/a | n/a | 1 | 1 | 100.0% | 1 | 208 | 208 | 100.0% | 208 | 1 | 1 | 100.0%
|
||||
```
|
||||
@@ -0,0 +1,46 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat repositories
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 55
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat repositories
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The cat repositories operation lists all completed and ongoing index and shard recoveries.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/repositories?v
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/repositories
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat repositories URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameters:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
local | Boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
id type
|
||||
repo1 fs
|
||||
repo2 s3
|
||||
```
|
||||
@@ -0,0 +1,57 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat segments
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 55
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat segments
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The cat segments operation lists Lucene segment-level information for each index.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/segments?v
|
||||
```
|
||||
|
||||
To see only the information about segments of a specific index, add the index name after your query.
|
||||
|
||||
```
|
||||
GET _cat/segments/<index>?v
|
||||
```
|
||||
|
||||
If you want to get information for more than one index, separate the indices with commas:
|
||||
|
||||
```
|
||||
GET _cat/segments/index1,index2,index3
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/segments
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat segments URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameter:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
bytes | Byte size | Specify the units for byte size. For example, `7kb` or `6gb`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/)..
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
index | shard | prirep | ip | segment | generation | docs.count | docs.deleted | size | size.memory | committed | searchable | version | compound
|
||||
movies | 0 | p | 172.18.0.4 | _0 | 0 | 1 | 0 | 3.5kb | 1364 | true | true | 8.7.0 | true
|
||||
movies | 0 | r | 172.18.0.3 | _0 | 0 | 1 | 0 | 3.5kb | 1364 | true | true | 8.7.0 | true
|
||||
```
|
||||
@@ -0,0 +1,60 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat shards
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 60
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat shards
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The cat shards operation lists the state of all primary and replica shards and how they are distributed.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/shards?v
|
||||
```
|
||||
|
||||
To see only the information about shards of a specific index, add the index name after your query.
|
||||
|
||||
```
|
||||
GET _cat/shards/<index>?v
|
||||
```
|
||||
|
||||
If you want to get information for more than one index, separate the indices with commas:
|
||||
|
||||
```
|
||||
GET _cat/shards/index1,index2,index3
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/shards
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat shards URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameter:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
bytes | Byte size | Specify the units for byte size. For example, `7kb` or `6gb`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
local | Boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
time | Time | Specify the units for time. For example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
index | shard | prirep | state | docs | store | ip | | node
|
||||
plugins | 0 | p | STARTED | 0 | 208b | 172.18.0.4 | odfe-node1
|
||||
plugins | 0 | r | STARTED | 0 | 208b | 172.18.0.3 | odfe-node2
|
||||
```
|
||||
@@ -0,0 +1,46 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat snapshots
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 65
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat snapshots
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The cat snapshots operation lists all snapshots for a repository.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/snapshots?v
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/snapshots
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat snapshots URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameter:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
time | Time | Specify the units for time. For example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
index | shard | prirep | state | docs | store | ip | | node
|
||||
plugins | 0 | p | STARTED | 0 | 208b | 172.18.0.4 | odfe-node1
|
||||
plugins | 0 | r | STARTED | 0 | 208b | 172.18.0.3 | odfe-node2
|
||||
```
|
||||
@@ -0,0 +1,47 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat tasks
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 70
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat tasks
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The cat tasks operation lists the progress of all tasks currently running on your cluster.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/tasks?v
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/tasks
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat tasks URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameter:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
nodes | List | A comma-separated list of node IDs or names to limit the returned information. Use `_local` to return information from the node you're connecting to, specify the node name to get information from specific nodes, or keep the parameter empty to get information from all nodes.
|
||||
detailed | Boolean | Returns detailed task information. (Default: false)
|
||||
parent_task_id | String | Returns tasks with a specified parent task ID (node_id:task_number). Keep empty or set to -1 to return all.
|
||||
time | Time | Specify the units for time. For example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
action | task_id | parent_task_id | type | start_time | timestamp | running_time | ip | node
|
||||
cluster:monitor/tasks/lists | 1vo54NuxSxOrbPEYdkSF0w:168062 | - | transport | 1624337809471 | 04:56:49 | 489.5ms | 172.18.0.4 | odfe-node1
|
||||
```
|
||||
@@ -0,0 +1,53 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat templates
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 70
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat templates
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The cat templates operation lists the names, patterns, order numbers, and version numbers of index templates.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/templates?v
|
||||
```
|
||||
|
||||
If you want to get information for more than one template, separate the template names with commas:
|
||||
|
||||
```
|
||||
GET _cat/shards/template_name_1,template_name_2,template_name_3
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/templates
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat templates URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameter:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
local | Boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```
|
||||
name | index_patterns order version composed_of
|
||||
tenant_template | [kibana*] | 0 |
|
||||
```
|
||||
|
||||
To learn more about index templates, see [Index templates]({{site.url}}{{site.baseurl}}/opensearch/index-templates).
|
||||
@@ -0,0 +1,53 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat thread pool
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 75
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat thread pool
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The cat thread pool operation lists the active, queued, and rejected threads of different thread pools on each node.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/thread_pool?v
|
||||
```
|
||||
|
||||
If you want to get information for more than one thread pool, separate the thread pool names with commas:
|
||||
|
||||
```
|
||||
GET _cat/v/thread_pool_name_1,thread_pool_name_2,thread_pool_name_3
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/thread_pool
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat thread pool URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameter:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
local | Boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
node_name name active queue rejected
|
||||
odfe-node2 ad-batch-task-threadpool 0 0 0
|
||||
odfe-node2 ad-threadpool 0 0 0
|
||||
odfe-node2 analyze 0 0 0s
|
||||
```
|
||||
@@ -0,0 +1,58 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT
|
||||
parent: REST API reference
|
||||
nav_order: 100
|
||||
has_children: true
|
||||
redirect_from:
|
||||
- /opensearch/catapis/
|
||||
---
|
||||
|
||||
# cat API
|
||||
|
||||
You can get essential statistics about your cluster in an easy-to-understand, tabular format using the compact and aligned text (CAT) API. The cat API is a human-readable interface that returns plain text instead of traditional JSON.
|
||||
|
||||
Using the cat API, you can answer questions like which node is the elected master, what state is the cluster in, how many documents are in each index, and so on.
|
||||
|
||||
## Example
|
||||
|
||||
To see the available operations in the cat API, use the following command:
|
||||
|
||||
```
|
||||
GET _cat
|
||||
```
|
||||
|
||||
## Common URL parameters
|
||||
|
||||
You can use the following string parameters with your query.
|
||||
|
||||
Parameter | Description
|
||||
:--- | :--- |
|
||||
`?v` | Makes the output more verbose by adding headers to the columns. It also adds some formatting to help align each of the columns together. All examples in this section include the `v` parameter.
|
||||
`?help` | Lists the default and other available headers for a given operation.
|
||||
`?h` | Limits the output to specific headers.
|
||||
`?format` | Outputs the result in JSON, YAML, or CBOR formats.
|
||||
`?sort` | Sorts the output by the specified columns.
|
||||
|
||||
To see what each column represents, use the `?v` parameter:
|
||||
|
||||
```
|
||||
GET _cat/<operation_name>?v
|
||||
```
|
||||
|
||||
To see all the available headers, use the `?help` parameter:
|
||||
|
||||
```
|
||||
GET _cat/<operation_name>?help
|
||||
```
|
||||
|
||||
To limit the output to a subset of headers, use the `?h` parameter:
|
||||
|
||||
```
|
||||
GET _cat/<operation_name>?h=<header_name_1>,<header_name_2>&v
|
||||
```
|
||||
|
||||
Typically, for any operation you can find out what headers are available using the `?help` parameter, and then use the `?h` parameter to limit the output to only the headers that you care about.
|
||||
|
||||
If you use the security plugin, make sure you have the appropriate permissions.
|
||||
{: .note }
|
||||
@@ -2,10 +2,12 @@
|
||||
layout: default
|
||||
title: Cluster allocation explain
|
||||
parent: REST API reference
|
||||
nav_order: 30
|
||||
nav_order: 10
|
||||
---
|
||||
|
||||
# Cluster allocation explain
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The most basic cluster allocation explain request finds an unassigned shard and explains why it can't be allocated to a node.
|
||||
|
||||
@@ -15,7 +17,7 @@ If you add some options, you can instead get information on a specific shard, in
|
||||
## Example
|
||||
|
||||
```json
|
||||
GET /_cluster/allocation/explain?include_yes_decisions=true
|
||||
GET _cluster/allocation/explain?include_yes_decisions=true
|
||||
{
|
||||
"index": "movies",
|
||||
"shard": 0,
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
layout: default
|
||||
title: Cluster health
|
||||
parent: REST API reference
|
||||
grand_parent: OpenSearch
|
||||
nav_order: 45
|
||||
nav_order: 15
|
||||
---
|
||||
|
||||
# Cluster health
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The most basic cluster health request returns a simple status of the health of your cluster. OpenSearch expresses cluster health in three colors: green, yellow, and red. A green status means all primary shards and their replicas are allocated to nodes. A yellow status means all primary shards are allocated to nodes, but some replicas aren't. A red status means at least one primary shard is not allocated to any node.
|
||||
|
||||
@@ -17,7 +18,7 @@ To get the status of a specific index, provide the index name.
|
||||
This request waits 50 seconds for the cluster to reach the yellow status or better:
|
||||
|
||||
```
|
||||
GET /_cluster/health?wait_for_status=yellow&timeout=50s
|
||||
GET _cluster/health?wait_for_status=yellow&timeout=50s
|
||||
```
|
||||
|
||||
If the cluster health becomes yellow or green before 50 seconds elapse, it returns a response immediately. Otherwise it returns a response as soon as it exceeds the timeout.
|
||||
@@ -25,8 +26,8 @@ If the cluster health becomes yellow or green before 50 seconds elapse, it retur
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET /_cluster/health
|
||||
GET /_cluster/health/<index>
|
||||
GET _cluster/health
|
||||
GET _cluster/health/<index>
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
@@ -35,18 +36,18 @@ All cluster health parameters are optional.
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
expand_wildcards | enum | Expands wildcard expressions to concrete indices. Combine multiple values with commas. Supported values are `all`, `open`, `closed`, `hidden`, and `none`. Default is `open`.
|
||||
level | enum | The level of detail for returned health information. Supported values are `cluster`, `indices`, and `shards`. Default is `cluster`.
|
||||
local | boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
master_timeout | time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
timeout | time | The amount of time to wait for a response. If the timeout expires, the request fails. Default is 30 seconds.
|
||||
wait_for_active_shards | string | Wait until the specified number of shards is active before returning a response. `all` for all shards. Default is `0`.
|
||||
wait_for_events | enum | Wait until all currently queued events with the given priority are processed. Supported values are `immediate`, `urgent`, `high`, `normal`, `low`, and `languid`.
|
||||
wait_for_no_relocating_shards | boolean | Whether to wait until there are no relocating shards in the cluster. Default is false.
|
||||
wait_for_no_initializing_shards | boolean | Whether to wait until there are no initializing shards in the cluster. Default is false.
|
||||
wait_for_status | enum | Wait until the cluster is in a specific state or better. Supported values are `green`, `yellow`, and `red`.
|
||||
expand_wildcards | Enum | Expands wildcard expressions to concrete indices. Combine multiple values with commas. Supported values are `all`, `open`, `closed`, `hidden`, and `none`. Default is `open`.
|
||||
level | Enum | The level of detail for returned health information. Supported values are `cluster`, `indices`, and `shards`. Default is `cluster`.
|
||||
local | Boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
timeout | Time | The amount of time to wait for a response. If the timeout expires, the request fails. Default is 30 seconds.
|
||||
wait_for_active_shards | String | Wait until the specified number of shards is active before returning a response. `all` for all shards. Default is `0`.
|
||||
wait_for_events | Enum | Wait until all currently queued events with the given priority are processed. Supported values are `immediate`, `urgent`, `high`, `normal`, `low`, and `languid`.
|
||||
wait_for_no_relocating_shards | Boolean | Whether to wait until there are no relocating shards in the cluster. Default is false.
|
||||
wait_for_no_initializing_shards | Boolean | Whether to wait until there are no initializing shards in the cluster. Default is false.
|
||||
wait_for_status | Enum | Wait until the cluster is in a specific state or better. Supported values are `green`, `yellow`, and `red`.
|
||||
|
||||
<!-- wait_for_nodes | string | Wait until the specified number of nodes is available. Also supports operators <=, >=, <, and >
|
||||
<!-- wait_for_nodes | string | Wait until the specified number of nodes is available. Also supports operators <=, >=, <, and >
|
||||
# Not working properly when tested -->
|
||||
|
||||
## Response
|
||||
@@ -69,4 +70,4 @@ wait_for_status | enum | Wait until the cluster is in a specific state or better
|
||||
"task_max_waiting_in_queue_millis" : 0,
|
||||
"active_shards_percent_as_number" : 100.0
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
---
|
||||
layout: default
|
||||
title: Cluster settings
|
||||
parent: REST API reference
|
||||
nav_order: 20
|
||||
---
|
||||
|
||||
# Cluster settings
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The cluster settings operation lets you check the current settings for your cluster, review default settings, and change settings. When you update a setting using the API, OpenSearch applies it to all nodes in the cluster.
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
```json
|
||||
GET _cluster/settings?include_defaults=true
|
||||
```
|
||||
|
||||
```json
|
||||
PUT _cluster/settings
|
||||
{
|
||||
"persistent": {
|
||||
"action": {
|
||||
"auto_create_index": false
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cluster/settings
|
||||
PUT _cluster/settings
|
||||
```
|
||||
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cluster settings parameters are optional.
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
flat_settings | Boolean | Whether to return settings in the flat form, which can improve readability, especially for heavily nested settings. For example, the flat form of `"cluster": { "max_shards_per_node": 500 }` is `"cluster.max_shards_per_node": "500"`.
|
||||
include_defaults (GET only) | Boolean | Whether to include default settings as part of the response. This parameter is useful for identifying the names and current values of settings you want to update.
|
||||
master_timeout | Time | The amount of time to wait for a response from the master node. Default is 30 seconds.
|
||||
timeout (PUT only) | Time | The amount of time to wait for a response from the cluster. Default is 30 seconds.
|
||||
|
||||
|
||||
## Request body
|
||||
|
||||
The GET operation has no request body options.
|
||||
|
||||
For a PUT operation, the request body must contain `transient` or `persistent`, along with the setting you want to update:
|
||||
|
||||
```json
|
||||
PUT _cluster/settings
|
||||
{
|
||||
"persistent": {
|
||||
"cluster": {
|
||||
"max_shards_per_node": 500
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
For more information about transient settings, persistent settings, and precedence, see [OpenSearch configuration]({{site.url}}{{site.baseurl}}/opensearch/configuration/).
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
{
|
||||
"acknowledged": true,
|
||||
"persistent": {
|
||||
"cluster": {
|
||||
"max_shards_per_node": "500"
|
||||
}
|
||||
},
|
||||
"transient": {}
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,163 @@
|
||||
---
|
||||
layout: default
|
||||
title: Create index
|
||||
parent: REST API reference
|
||||
nav_order: 3
|
||||
---
|
||||
|
||||
# Create index
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
While you can create an index by using a document as a base, you can also just create an empty index for use later.
|
||||
|
||||
## Example
|
||||
|
||||
The following example demonstrates how to create an index with a non-default number of primary and replica shards, specifies that `age` is of type `integer`, and assigns a `sample-alias1` alias to the index.
|
||||
|
||||
```json
|
||||
PUT /sample-index1
|
||||
|
||||
{
|
||||
"settings": {
|
||||
"index": {
|
||||
"number_of_shards": 2,
|
||||
"number_of_replicas": 1
|
||||
}
|
||||
},
|
||||
"mappings": {
|
||||
"properties": {
|
||||
"age": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"aliases": {
|
||||
"sample-alias1": {}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
PUT <index-name>
|
||||
```
|
||||
|
||||
## Index naming restrictions
|
||||
|
||||
OpenSearch indices have the following naming restrictions:
|
||||
|
||||
- All letters must be lowercase.
|
||||
- Index names can't begin with underscores (`_`) or hyphens (`-`).
|
||||
- Index names can't contain spaces, commas, or the following characters:
|
||||
|
||||
`:`, `"`, `*`, `+`, `/`, `\`, `|`, `?`, `#`, `>`, or `<`
|
||||
|
||||
## URL parameters
|
||||
|
||||
You can include the following URL parameters in your request. All parameters are optional.
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
include_type_name | Boolean | If `true`, the request expects a type in the body of mappings. Because OpenSearch indices all have a type of `_doc`, we recommend that this parameter is left as the default of `false.`
|
||||
wait_for_active_shards | String | Specifies the number of active shards that must be available before OpenSearch processes the request. Default is 1 (only the primary shard). Set to `all` or a positive integer. Values greater than 1 require replicas. For example, if you specify a value of 3, the index must have two replicas distributed across two additional nodes for the request to succeed.
|
||||
master_timeout | Time | How long to wait for a connection to the master node. Default is `30s`.
|
||||
timeout | Time | How long to wait for the request to return. Default is `30s`.
|
||||
|
||||
## Request body
|
||||
|
||||
As part of your request, you can supply parameters in your request's body that specify index settings, mappings, and [aliases]({{site.url}}{{site.baseurl}}/opensearch/index-alias/) for your newly created index. The following sections provide more information about index settings and mappings.
|
||||
|
||||
|
||||
### Index settings
|
||||
|
||||
Index settings are separated into two varieties: static index settings and dynamic index settings. Static index settings are settings that you specify at index creation and can't change later. You can change dynamic settings at any time, including at index creation.
|
||||
|
||||
#### Static index settings
|
||||
|
||||
Setting | Description
|
||||
:--- | :---
|
||||
index.number_of_shards | The number of primary shards in the index. Default is 1.
|
||||
index.number_of_routing_shards | The number of routing shards used to split an index.
|
||||
index.shard.check_on_startup | Whether the index's shards should be checked for corruption. Available options are `false` (do not check for corruption), `checksum` (check for physical corruption), and `true` (check for both physical and logical corruption). Default is `false`.
|
||||
index.codec | The compression type to use to compress stored data. Available values are `best_compression` and `default`.
|
||||
index.routing_partition_size | The number of shards a custom routing value can go to. Routing helps an imbalanced cluster by relocating values to a subset of shards rather than just a single shard. To enable, set this value to greater than 1 but less than `index.number_of_shards`. Default is 1.
|
||||
index.soft_deletes_enabled | Whether to retain a history of operations performed on the index.
|
||||
index.soft_deletes.retention_lease.period | The maximum amount of time to retain a shard's history of operations. Default is `12h`.
|
||||
index.load_fixed_bitset_filters_eagerly | Indicates whether cached filters should be pre-loaded for nested queries. Available options are `true` and `false`. Default is `true`.
|
||||
index.hidden | Whether the index should be hidden. Hidden indices are not returned as part of queries that have wildcards. Available options are `true` and `false`. Default is `false`.
|
||||
|
||||
#### Dynamic index Settings
|
||||
|
||||
Setting | Description
|
||||
:--- | :---
|
||||
index.number_of_replicas | The number of replica shards each primary shard should have. For example, if you have 4 primary shards and set `index.number_of_replicas` to 3, the index has 12 replica shards. Default is 1.
|
||||
index.auto_expand_replicas | Automatically expands the number of replicas based on the amount of data nodes in the cluster. Specify a lower bound and upper limit (for example, 0-9), or `all` for the upper limit. For example, if you have 5 data nodes and set `index.auto_expand_replicas` to 0-3, then the cluster does not autoamtically add another replica shard. However, if you set this value to `0-all` and add 2 more nodes for a total of 7, the cluster will expand to now have 6 replica shards. Default is disabled.
|
||||
index.search.idle.after | Amount of time a shard should wait for a search or get request until it goes idle. Default is `30s`.
|
||||
index.refresh_interval | How often the index should refresh, which publishes its most recent changes and makes them available for searching. Can be set to `-1` to disable refreshing. Default is `1s`.
|
||||
index.max_result_window | The maximum value of `from` + `size` for searches to the index. `from` is the starting index to search from, and `size` is the amount of results to return. Default: 10000.
|
||||
index.max_inner_result_window | The maximum value of `from` + `size` for inner hits definitions and top hits aggregations to the index. `from` is the starting index to search from, and `size` is the amount of top hits to return. Default is 100.
|
||||
index.max_rescore_window | The maximum value of `window_size` for rescore requests to the index. Rescore requests reorder the index's documents and return a new score, which can be more precise. Default is the same as index.max_inner_result_window or 10000 by default.
|
||||
index.max_docvalue_fields_search | Maximum amount of `docvalue_fields` allowed in a query. Default is 100.
|
||||
index.max_script_fields | Maximum amount of `script_fields` allowed in a query. Default is 32.
|
||||
index.max_ngram_diff | Maximum allowed difference between `min_gram` and `max_gram` values for `NGramTokenizer` and `NGramTokenFilter`. Default is 1.
|
||||
index.max_shingle_diff | Maximum allowed difference between `max_shingle_size` and `min_shingle_size` for the `shingle` token filter. Default is 3.
|
||||
index.max_refresh_listeners | Maximum amount of refresh listeners available on the index's shards.
|
||||
index.analyze.max_token_count | Maximum amount of tokens that can return from the `_analyze` API operation. Default is 10000.
|
||||
index.highlight.max_analyzed_offset | The maximum amount of characters that will be analyzed in a highlight request. Default is 1000000.
|
||||
index.max_terms_count | The maximum amount of terms that can be used in a terms query. Default is 65536.
|
||||
index.max_regex_length | The maximum character length of regex that can be in a regexp query. Default is 1000.
|
||||
index.query.default_field | A field or list of fields that OpenSearch uses in queries in case a field isn't specified in the parameters.
|
||||
index.routing.allocation.enable | Specifies options for the index's shard allocation. Available options are `all` (allow shard allocation for all shards), `primaries` (allow shard allocation only for primary shards), `new_primaries` (allow shard allocaiton only for new primary shards), and `none` (do not allow shard allocation). Default is `all`.
|
||||
index.routing.rebalance.enable | Enables shard rebalancing for the index. Available options are `all` (allow shard rebalancing for all shards), `primaries`, (allow shard rebalancing only for primary shards), `replicas` (allow shard rebalancing only for replicas), and `none` (do not allow shard rebalancing). Default is `all`.
|
||||
index.gc_deletes | Amount of time to retain a deleted document's version number. Default is `60s`.
|
||||
index.default_pipeline | The default ingest node pipeline for the index. If the default pipeline is set and the pipeline does not exist, then index requests fail. The pipeline name `_none` specifies that the index does not have an ingest pipeline.
|
||||
index.final_pipeline | The final ingest node pipeline for the index. If the final pipeline is set and the pipeline does not exist, then index requests fail. The pipeline name `_none` specifies that the index does not have an ingest pipeline.
|
||||
|
||||
### Mappings
|
||||
|
||||
Mappings define how a documents and its fields are stored and indexed. If you're just starting to build out your cluster and data, you may not know exactly how your data should be stored. In those cases, you can use dynamic mappings, which tell OpenSearch to dynamically add data and their fields. However, if you know exactly what types your data fall under and want to enforce that standard, then you can use explicit mappings.
|
||||
|
||||
For example, if you want to indicate that `year` should be of type `text` instead of an `integer`, and `age` should be an `integer`, you can do so with explicit mappings. Using dynamic mapping, OpenSearch might interpret both `year` and `age` as integers.
|
||||
|
||||
#### Dynamic mapping types
|
||||
|
||||
Type | Description
|
||||
:--- | :---
|
||||
null | A `null` field can't be indexed or searched. When a field is set to null, OpenSearch behaves as if that field has no values.
|
||||
boolean | OpenSearch accepts `true` and `false` as boolean values. An empty string is equal to `false.`
|
||||
float | A single-precision 32-bit floating point number.
|
||||
double | A double-precision 64-bit floating point number.
|
||||
integer | A signed 32-bit number.
|
||||
object | Objects are standard JSON objects, which can have fields and mappings of their own. For example, a `movies` object can have additional properties such as `title`, `year`, and `director`.
|
||||
array | Arrays in OpenSearch can only store values of one type, such as an array of just integers or strings. Empty arrays are treated as though they are fields with no values.
|
||||
text | A string sequence of characters that represent full-text values.
|
||||
keyword | A string sequence of structured characters, such as an email or ZIP code.
|
||||
date detection string | Enabled by default, if new string fields match a date's format, then the string is processed as a `date` field. For example, `date: "2012/03/11"` is processed as a date.
|
||||
numeric detection string | If disabled, OpenSearch may automatically process numeric values as strings when they should be processed as numbers. When enabled, OpenSearch can process strings into `long`, `integer`, `short`, `byte`, `double`, `float`, `half_float`, `scaled_float`, `unsigned_long`. Default is disabled.
|
||||
|
||||
#### Explicit mapping
|
||||
|
||||
If you know exactly what your data's typings need to be, you can specify them in your request body when creating your index.
|
||||
|
||||
```json
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
"year": { "type" : "text" },
|
||||
"age": { "type" : "integer" },
|
||||
"director":{ "type" : "text" }
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Response
|
||||
```json
|
||||
{
|
||||
"acknowledged": true,
|
||||
"shards_acknowledged": true,
|
||||
"index": "sample-index1"
|
||||
}
|
||||
```
|
||||
@@ -1,11 +1,14 @@
|
||||
---
|
||||
layout: default
|
||||
title: Bulk
|
||||
parent: REST API reference
|
||||
nav_order: 15
|
||||
parent: Document APIs
|
||||
grand_parent: REST API reference
|
||||
nav_order: 20
|
||||
---
|
||||
|
||||
# Bulk
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The bulk operation lets you add, update, or delete many documents in a single request. Compared to individual OpenSearch indexing requests, the bulk operation has significant performance benefits. Whenever practical, we recommend batching indexing operations into bulk requests.
|
||||
|
||||
@@ -32,7 +35,7 @@ POST _bulk
|
||||
POST {index}/_bulk
|
||||
```
|
||||
|
||||
Specifying the index in the path means you don't need to include it in the [request body](#request-body).
|
||||
Specifying the index in the path means you don't need to include it in the [request body]({{site.url}}{{site.baseurl}}/opensearch/rest-api/document-apis/bulk/#request-body).
|
||||
|
||||
OpenSearch also accepts PUT requests to the `_bulk` path, but we highly recommend using POST. The accepted usage of PUT---adding or replacing a single resource at a given path---doesn't make sense for bulk requests.
|
||||
{: .note }
|
||||
@@ -0,0 +1,123 @@
|
||||
---
|
||||
layout: default
|
||||
title: Delete by query
|
||||
parent: Document APIs
|
||||
grand_parent: REST API reference
|
||||
nav_order: 40
|
||||
---
|
||||
|
||||
# Delete by query
|
||||
Introduced 1.0
|
||||
{: .label .label-purple}
|
||||
|
||||
You can include a query as part of your delete request so OpenSearch deletes all documents that match that query.
|
||||
|
||||
## Example
|
||||
|
||||
```json
|
||||
POST sample-index1/_delete_by_query
|
||||
{
|
||||
"query": {
|
||||
"match": {
|
||||
"movie-length": "124"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
POST <target>/_delete_by_query
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All URL parameters are optional.
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :--- | :---
|
||||
<index> | String | Name of the data streams, indices, or aliases to delete from. Supports wildcards. If left blank, OpenSearch searches all indices.
|
||||
allow_no_indices | Boolean | False indicates to OpenSearch the request should return an error if any wildcard expression or index alias targets only missing or closed indices. Default is true.
|
||||
analyzer | String | The analyzer to use in the query string.
|
||||
analyze_wildcard | Boolean | Specifies whether to analyze wildcard and prefix queries. Default is false.
|
||||
conflicts | String | Indicates to OpenSearch what should happen if the delete by query operation runs into a version conflict. Valid options are `abort` and `proceed`. Default is `abort`.
|
||||
default_operator | String | Indicates whether the default operator for a string query should be AND or OR. Default is OR.
|
||||
df | String | The default field in case a field prefix is not provided in the query string.
|
||||
expand_wildcards | String | Specifies the type of index that wildcard expressions can match. Supports comma-separated values. Valid values are `all` (match any index), `open` (match open, non-hidden indices), `closed` (match closed, non-hidden indices), `hidden` (match hidden indices), and `none` (deny wildcard expressions). Default is `open`.
|
||||
from | Integer | The starting index to search from. Default is 0.
|
||||
ignore_unavailable | Boolean | Specifies whether to include missing or closed indices in the response. Default is false.
|
||||
lenient | Boolean | Specifies whether OpenSearch should ignore format-based query failures (for example, querying a text field for an integer). Default is false.
|
||||
max_docs | Integer | Maximum amount of documents the operation should process. Default is all documents.
|
||||
preference | String | Specifies the shard or node OpenSearch should perform the operation on.
|
||||
q | String | Query in the Lucene query string syntax.
|
||||
request_cache | Boolean | Specifies whether OpenSearch should use the request cache for the request. Default is whether it's enabled in the index's settings.
|
||||
refresh | Boolean | Specifies whether OpenSearch should refresh all of the shards involved in the delete request once the operation finishes. Default is false.
|
||||
requests_per_second | Integer | Specifies the request's throttling in sub-requests per second. Default is -1, which means no throttling.
|
||||
routing | String | Value used to route the operation to a specific shard.
|
||||
scroll | Time | Amount of time the search context should be open.
|
||||
scroll_size | Integer | Size of the scroll request of the operation. Default is 1000.
|
||||
search_type | String | Whether OpenSearch should use global term and document frequencies calculating revelance scores. Valid choices are `query_then_fetch` and `dfs_query_then_fetch`. `query_then_fetch` scores documents using local term and document frequencies for the shard. It’s usually faster but less accurate. `dfs_query_then_fetch` scores documents using global term and document frequencies across all shards. It’s usually slower but more accurate. Default is `query_then_fetch`.
|
||||
search_timeout | Time | Amount of time until timeout for the search request. Default is no timeout.
|
||||
slices | Integer | Number of sub-tasks OpenSearch should divide this task into. Default is 1, which means OpenSearch should not divide this task.
|
||||
sort | String | A comma-separated list of <field> : <direction> pairs to sort by.
|
||||
_source | String | Specifies whether to include the `_source` field in the response.
|
||||
_source_excludes | String | A comma-separated list of source fields to exclude from the response.
|
||||
_source_includes | String | A comma-separated list of source fields to include in the response.
|
||||
stats | String | Value to associate with the request for additional logging.
|
||||
terminate_after | Integer | The maximum number of documents OpenSearch should process before terminating the request.
|
||||
timeout | Time | How long the operation should wait from a response from active shards. Default is `1m`.
|
||||
version | Boolean | Whether to include the document version as a match.
|
||||
wait_for_active_shards | String | The number of shards that must be active before OpenSearch executes the operation. Valid values are `all` or any integer up to the total number of shards in the index. Default is 1, which is the primary shard.
|
||||
|
||||
## Request body
|
||||
|
||||
To search your index for specific documents, you must include a [query]({{site.url}}{{site.baseurl}}/opensearch/query-dsl/index) in the request body that OpenSearch uses to match documents. If you don't use a query, OpenSearch treats your delete request as a simple [delete document operation]({{site.url}}{{site.baseurl}}/opensearch/rest-api/document-apis/delete-document).
|
||||
|
||||
```json
|
||||
{
|
||||
"query": {
|
||||
"match": {
|
||||
"movie-length": "124"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Response
|
||||
```json
|
||||
{
|
||||
"took": 143,
|
||||
"timed_out": false,
|
||||
"total": 1,
|
||||
"deleted": 1,
|
||||
"batches": 1,
|
||||
"version_conflicts": 0,
|
||||
"noops": 0,
|
||||
"retries": {
|
||||
"bulk": 0,
|
||||
"search": 0
|
||||
},
|
||||
"throttled_millis": 0,
|
||||
"requests_per_second": -1.0,
|
||||
"throttled_until_millis": 0,
|
||||
"failures": []
|
||||
}
|
||||
```
|
||||
|
||||
## Response body fields
|
||||
|
||||
Field | Description
|
||||
:--- | :---
|
||||
took | The amount of time in milliseconds OpenSearch needed to complete the operation.
|
||||
timed_out | Whether any delete requests during the operation timed out.
|
||||
total | Total number of documents processed.
|
||||
deleted | Total number of documents deleted.
|
||||
batches | Number of scroll responses the request processed.
|
||||
version_conflicts | Number of conflicts the request ran into.
|
||||
noops | How many delete requests OpenSearch ignored during the operation. This field always returns 0.
|
||||
retries | The number of bulk and search retry requests.
|
||||
throttled_millis | Number of throttled milliseconds during the request.
|
||||
requests_per_second | Number of requests executed per second during the operation.
|
||||
throttled_until_millis | The amount of time until OpenSearch executes the next throttled request. Always equal to 0 in a delete by query request.
|
||||
failures | Any failures that occur during the request.
|
||||
@@ -0,0 +1,75 @@
|
||||
---
|
||||
layout: default
|
||||
title: Delete document
|
||||
parent: Document APIs
|
||||
grand_parent: REST API reference
|
||||
nav_order: 15
|
||||
---
|
||||
|
||||
# Delete document
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
If you no longer need a document in your index, you can use the delete document API operation to delete it.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
DELETE /sample-index1/_doc/1
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
DELETE /<index-name>/_doc/<_id>
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
Parameter | Type | Description | Required
|
||||
:--- | :--- | :--- | :---
|
||||
<index-name> | String | The index to delete from. | Yes
|
||||
<_id> | String | The ID of the document to delete. | Yes
|
||||
if_seq_no | Integer | Only perform the delete operation if the document's version number matches the specified number. | No
|
||||
if_primary_term | Integer | Only perform the delete operation if the document has the specified primary term. | No
|
||||
refresh | Enum | If true, OpenSearch refreshes shards to make the operation visible to searching. Valid options are `true`, `false`, and `wait_for`, which tells OpenSearch to wait for a refresh before executing the operation. Default is false. | No
|
||||
routing | String | Value used to route the operation to a specific shard. | No
|
||||
timeout | Time | How long to wait for a response from the cluster. | No
|
||||
version | Integer | The version of the document to delete, which must match the last updated version of the document. | No
|
||||
version_type | Enum | Retrieves a specifically typed document. Available options are `external` (retrieve the document if the specified version number is greater than the document's current version) and `external_gte` (retrieve the document if the specified version number is greater than or equal to the document's current version). For example, to delete version 3 of a document, use `/_doc/1?version=3&version_type=external`. | No
|
||||
wait_for_active_shards | String | The number of active shards that must be available before OpenSearch processes the delete request. Default is 1 (only the primary shard). Set to `all` or a positive integer. Values greater than 1 require replicas. For example, if you specify a value of 3, the index must have two replicas distributed across two additional nodes for the operation to succeed. | No
|
||||
|
||||
|
||||
## Response
|
||||
```json
|
||||
{
|
||||
"_index": "sample-index1",
|
||||
"_type": "_doc",
|
||||
"_id": "1",
|
||||
"_version": 2,
|
||||
"result": "deleted",
|
||||
"_shards": {
|
||||
"total": 2,
|
||||
"successful": 2,
|
||||
"failed": 0
|
||||
},
|
||||
"_seq_no": 1,
|
||||
"_primary_term": 15
|
||||
}
|
||||
```
|
||||
|
||||
## Response body fields
|
||||
|
||||
Field | Description
|
||||
:--- | :---
|
||||
_index | The name of the index.
|
||||
_type | The document's type. OpenSearch only supports one type, which is `_doc`.
|
||||
_id | The document's ID.
|
||||
_version | The document's version.
|
||||
_result | The result of the delete operation.
|
||||
_shards | Detailed information about the cluster's shards.
|
||||
total | The total number of shards.
|
||||
successful | The number of shards OpenSearch succssfully deleted the document from.
|
||||
failed | The number of shards OpenSearch failed to delete the document from.
|
||||
_seq_no | The sequence number assigned when the document was indexed.
|
||||
_primary_term | The primary term assigned when the document was indexed.
|
||||
@@ -0,0 +1,79 @@
|
||||
---
|
||||
layout: default
|
||||
title: Get document
|
||||
parent: Document APIs
|
||||
grand_parent: REST API reference
|
||||
nav_order: 5
|
||||
---
|
||||
|
||||
# Get document
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
After adding a JSON document to your index, you can use the get document API operation to retrieve the document's information and data.
|
||||
|
||||
## Example
|
||||
|
||||
```json
|
||||
GET sample-index1/_doc/1
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET <index>/_doc/<_id>
|
||||
HEAD <index>/_doc/<_id>
|
||||
```
|
||||
```
|
||||
GET <index>/_source/<_id>
|
||||
HEAD <index>/_source/<_id>
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All get document URL parameters are optional.
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
preference | String | Specifies a preference of which shard to retrieve results from. Available options are `_local`, which tells the operation to retrieve results from a locally allocated shard replica, and a custom string value assigned to a specific shard replica. By default, OpenSearch executes get document operations on random shards.
|
||||
realtime | Boolean | Specifies whether the operation should run in realtime. If false, the operation waits for the index to refresh to analyze the source to retrieve data, which makes the operation near-realtime. Default is true.
|
||||
refresh | Boolean | If true, OpenSearch refreshes shards to make the operation visible to searching. Default is false.
|
||||
routing | String | A value used to route the operation to a specific shard.
|
||||
stored_fields | Boolean | If true, the operation retrieves document fields stored in the index rather than the document's `_source`. Default is false.
|
||||
_source | String | Whether to include the `_source` field in the response body. Default is true.
|
||||
_source_excludes | String | A comma-separated list of source fields to exclude in the query response.
|
||||
_source_includes | String | A comma-separated list of source fields to include in the query response.
|
||||
version | Integer | The version of the document to return, which must match the current version of the document.
|
||||
version_type | Enum | Retrieves a specifically typed document. Available options are `external` (retrieve the document if the specified version number is greater than the document's current version) and `external_gte` (retrieve the document if the specified version number is greater than or equal to the document's current version). For example, to retrieve version 3 of a document, use `/_doc/1?version=3&version_type=external`.
|
||||
|
||||
|
||||
## Response
|
||||
```json
|
||||
{
|
||||
"_index": "sample-index1",
|
||||
"_type": "_doc",
|
||||
"_id": "1",
|
||||
"_version": 1,
|
||||
"_seq_no": 0,
|
||||
"_primary_term": 9,
|
||||
"found": true,
|
||||
"_source": {
|
||||
"text": "This is just some sample text."
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Response body fields
|
||||
|
||||
Field | Description
|
||||
:--- | :---
|
||||
_index | The name of the index.
|
||||
_type | The document's type. OpenSearch only supports one type, which is `_doc`.
|
||||
_id | The document's ID.
|
||||
_version | The document's version number. Updated whenever the document changes.
|
||||
_seq_no | The sequnce number assigned when the document is indexed.
|
||||
primary_term | The primary term assigned when the document is indexed.
|
||||
found | Whether the document exists.
|
||||
_routing | The shard that the document is routed to. If the document is not routed to a particular shard, this field is omitted.
|
||||
_source | Contains the document's data if `found` is true. If `_source` is set to false or `stored_fields` is set to true in the URL parameters, this field is omitted.
|
||||
_fields | Contains the document's data that's stored in the index. Only returned if both `stored_fields` and `found` are true.
|
||||
@@ -0,0 +1,95 @@
|
||||
---
|
||||
layout: default
|
||||
title: Index document
|
||||
parent: Document APIs
|
||||
grand_parent: REST API reference
|
||||
nav_order: 1
|
||||
---
|
||||
|
||||
# Index document
|
||||
Introduced 1.0
|
||||
{: .label .label-purple}
|
||||
|
||||
Before you can search for data, you must first add documents. This operation adds a single document to your index.
|
||||
|
||||
## Example
|
||||
|
||||
```json
|
||||
PUT sample-index/_doc/1
|
||||
{
|
||||
"Description": "To be or not to be, that is the question."
|
||||
}
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
PUT <index>/_doc/<_id>
|
||||
POST <index>/_doc
|
||||
|
||||
PUT <index>/_create/<_id>
|
||||
POST <index>/_create/<_id>
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
In your request, you must specify the index you want to add your document to. If the index doesn't already exist, OpenSearch automatically creates the index and adds in your document. All other URL parameters are optional.
|
||||
|
||||
Parameter | Type | Description | Required
|
||||
:--- | :--- | :--- | :---
|
||||
<index> | String | Name of the index. | Yes
|
||||
<_id> | String | A unique identifier to attach to the document. To automatically generate an ID, use `POST <target>/doc` in your request instead of PUT. | No
|
||||
if_seq_no | Integer | Only perform the operation if the document has the specified sequence number. | No
|
||||
if_primary_term | Integer | Only perform the operation if the document has the specified primary term. | No
|
||||
op_type | Enum | Specifies the type of operation to complete with the document. Valid values are `create` (create the index if it doesn't exist) and `index`. If a document ID is included in the request, then the default is `index`. Otherwise, the default is `create`. | No
|
||||
pipeline | String | ID used to route the indexing operation to a certain pipeline. | No
|
||||
routing | String | Value used to assign operations to specific shards. | No
|
||||
timeout | Time | How long to wait for a response from the cluster. Default is `1m`. | No
|
||||
version | Integer | The document's version number. | No
|
||||
version_type | Enum | Assigns a specific type to the document. Valid options are `external` (retrieve the document if the specified version number is greater than the document's current version) and `external_gte` (retrieve the document if the specified version number is greater than or equal to the document's current version). For example, to index version 3 of a document, use `/_doc/1?version=3&version_type=external`. | No
|
||||
wait_for_active_shards | String | The number of active shards that must be available before OpenSearch processes the request. Default is 1 (only the primary shard). Set to `all` or a positive integer. Values greater than 1 require replicas. For example, if you specify a value of 3, the index must have two replicas distributed across two additional nodes for the operation to succeed. | No
|
||||
require_alias | Boolean | Specifies whether the target index must be an index alias. Default is false. | No
|
||||
|
||||
## Request body
|
||||
|
||||
Your request body must contain the information you want to index.
|
||||
|
||||
```json
|
||||
{
|
||||
"Description": "This is just a sample document"
|
||||
}
|
||||
```
|
||||
|
||||
## Response
|
||||
```json
|
||||
{
|
||||
"_index": "sample-index",
|
||||
"_type": "_doc",
|
||||
"_id": "1",
|
||||
"_version": 1,
|
||||
"result": "created",
|
||||
"_shards": {
|
||||
"total": 2,
|
||||
"successful": 1,
|
||||
"failed": 0
|
||||
},
|
||||
"_seq_no": 0,
|
||||
"_primary_term": 1
|
||||
}
|
||||
```
|
||||
|
||||
## Response body fields
|
||||
|
||||
Field | Description
|
||||
:--- | :---
|
||||
_index | The name of the index.
|
||||
_type | The document's type. OpenSearch supports only one type, which is `_doc`.
|
||||
_id | The document's ID.
|
||||
_version | The document's version.
|
||||
_result | The result of the index operation.
|
||||
_shards | Detailed information about the cluster's shards.
|
||||
total | The total number of shards.
|
||||
successful | The number of shards OpenSearch succssfully added the document to.
|
||||
failed | The number of shards OpenSearch failed to added the document to.
|
||||
_seq_no | The sequence number assigned when the document was indexed.
|
||||
_primary_term | The primary term assigned when the document was indexed.
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
layout: default
|
||||
title: Document APIs
|
||||
parent: REST API reference
|
||||
has_children: true
|
||||
nav_order: 7
|
||||
redirect_from:
|
||||
- /opensearch/rest-api/document-apis/
|
||||
---
|
||||
|
||||
# Document APIs
|
||||
|
||||
The document APIs allow you to handle documents relative to your index, such as adding, updating, and deleting documents.
|
||||
|
||||
Document APIs are separated into two categories: single document operations and multi-document operations. Multi-document operations offer performance advantages over submitting many individual requests, so whenever practical, we recommend that you use multi-document operations.
|
||||
|
||||
## Single document operations
|
||||
|
||||
- Index
|
||||
- Get
|
||||
- Delete
|
||||
- Update
|
||||
|
||||
## Multi-document operations
|
||||
|
||||
- Bulk
|
||||
- Multi get
|
||||
- Delete by query
|
||||
- Update by query
|
||||
- Reindex
|
||||
@@ -0,0 +1,143 @@
|
||||
---
|
||||
layout: default
|
||||
title: Multi-get document
|
||||
parent: Document APIs
|
||||
grand_parent: REST API reference
|
||||
nav_order: 30
|
||||
---
|
||||
|
||||
# Multi-get documents
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
The multi-get operation allows you to execute multiple GET operations in one request, so you can get back all documents that match your criteria.
|
||||
|
||||
## Example without specifying index in URL
|
||||
|
||||
```json
|
||||
GET _mget
|
||||
|
||||
{
|
||||
"docs": [
|
||||
{
|
||||
"_index": "sample-index1",
|
||||
"_id": "1"
|
||||
},
|
||||
{
|
||||
"_index": "sample-index2",
|
||||
"_id": "1",
|
||||
"_source": {
|
||||
"include": ["Length"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Example of specifying index in URL
|
||||
|
||||
```json
|
||||
GET sample-index1/_mget
|
||||
|
||||
{
|
||||
"docs": [
|
||||
{
|
||||
"_type": "_doc",
|
||||
"_id": "1",
|
||||
"_source": false
|
||||
},
|
||||
{
|
||||
"_type": "_doc",
|
||||
"_id": "2",
|
||||
"_source": [ "Director", "Title" ]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _mget
|
||||
GET <index>/_mget
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All multi-get URL parameters are optional.
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :--- | :---
|
||||
<index> | String | Name of the index to retrieve documents from.
|
||||
preference | String | The node or shard that OpenSearch should perform the operation on. Default is random.
|
||||
realtime | Boolean | Specifies whether the operation should run in realtime. If false, the operation waits for the index to refresh to analyze the source to retrieve data, which makes the operation near-realtime. Default is `true`.
|
||||
refresh | Boolean | If true, OpenSearch refreshes shards to make the operation visible to searching. Default is `false`.
|
||||
routing | String | A value used to route the operation to a specific shard.
|
||||
stored_fields | Boolean | If true, the operation retrieves document fields stored in the index rather than the document's `_source`. Default is `false`.
|
||||
_source | String | Whether to include the `_source` field in the query response. Default is `true`.
|
||||
_source_excludes | String | A comma-separated list of source fields to exclude in the query response.
|
||||
_source_includes | String | A comma-separated list of source fields to include in the query response.
|
||||
|
||||
## Request body
|
||||
|
||||
If you don't specify an index in your request's URL, you must specify your target indices and the relevant document IDs in the request body. Other fields are optional.
|
||||
|
||||
Field | Type | Description | Required
|
||||
:--- | :--- | :--- | :---
|
||||
docs | Array | The documents you want to retrieve data from. Can contain the attributes: `_id`, `_index`, `_routing`, `_source`, and `_stored_fields`. If you specify an index in the URL, you can omit this field and add IDs of the documents to retrieve. | Yes if an index is not specified in the URL
|
||||
_id | String | The ID of the document. | Yes if `docs` is specified in the request body
|
||||
_index | String | Name of the index. | Yes if an index is not specified in the URL
|
||||
_routing | String | The value of the shard that has the document. | Yes if a routing value was used when indexing the document
|
||||
_source | Object | Specifies whether to return the `_source` field from an index (boolean), whether to return specific fields (array), or whether to include or exclude certain fields. | No
|
||||
_source.includes | Array | Specifies which fields to include in the query response. For example, `"_source": { "include": ["Title"] }` retrieves `Title` from the index. | No
|
||||
_source.excludes | Array | Specifies which fields to exclude in the query response. For example, `"_source": { "exclude": ["Director"] }` excludes `Director` from the query response. | No
|
||||
ids | Array | IDs of the documents to retrieve. Only allowed when an index is specified in the URL. | No
|
||||
|
||||
## Response
|
||||
```json
|
||||
{
|
||||
"docs": [
|
||||
{
|
||||
"_index": "sample-index1",
|
||||
"_type": "_doc",
|
||||
"_id": "1",
|
||||
"_version": 4,
|
||||
"_seq_no": 5,
|
||||
"_primary_term": 19,
|
||||
"found": true,
|
||||
"_source": {
|
||||
"Title": "Batman Begins",
|
||||
"Director": "Christopher Nolan"
|
||||
}
|
||||
},
|
||||
{
|
||||
"_index": "sample-index2",
|
||||
"_type": "_doc",
|
||||
"_id": "1",
|
||||
"_version": 1,
|
||||
"_seq_no": 6,
|
||||
"_primary_term": 19,
|
||||
"found": true,
|
||||
"_source": {
|
||||
"Title": "The Dark Knight",
|
||||
"Director": "Christopher Nolan"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Response body fields
|
||||
|
||||
Field | Description
|
||||
:--- | :---
|
||||
_index | The name of the index.
|
||||
_type | The document's type. OpenSearch only supports one type, which is `_doc`.
|
||||
_id | The document's ID.
|
||||
_version | The document's version number. Updated whenever the document changes.
|
||||
_seq_no | The sequnce number assigned when the document is indexed.
|
||||
primary_term | The primary term assigned when the document is indexed.
|
||||
found | Whether the document exists.
|
||||
_routing | The shard that the document is routed to. If the document is not routed to a particular shard, this field is omitted.
|
||||
_source | Contains the document's data if `found` is true. If `_source` is set to false or `stored_fields` is set to true in the URL parameters, this field is omitted.
|
||||
_fields | Contains the document's data that's stored in the index. Only returned if both `stored_fields` and `found` are true.
|
||||
@@ -0,0 +1,139 @@
|
||||
---
|
||||
layout: default
|
||||
title: Update by query
|
||||
parent: Document APIs
|
||||
grand_parent: REST API reference
|
||||
nav_order: 50
|
||||
---
|
||||
|
||||
# Update by query
|
||||
Introduced 1.0
|
||||
{: .label .label-purple}
|
||||
|
||||
You can include a query and a script as part of your update request so OpenSearch can run the script to update all of the documents that match the query.
|
||||
|
||||
## Example
|
||||
|
||||
```json
|
||||
POST test-index1/_update_by_query
|
||||
{
|
||||
"query": {
|
||||
"term": {
|
||||
"oldValue": 10
|
||||
}
|
||||
},
|
||||
"script" : {
|
||||
"source": "ctx._source.oldValue += params.newValue",
|
||||
"lang": "painless",
|
||||
"params" : {
|
||||
"newValue" : 20
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
POST <target-index1>, <target-index2>/_update_by_query
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All URL parameters are optional.
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :--- | :---
|
||||
<target-index> | String | Comma-separated list of indices to update. To update all indices, use * or omit this parameter.
|
||||
allow_no_indices | String | If false, the request returns an error if wildcard expressions match closed or missing indices. Default is true.
|
||||
analyzer | String | Analyzer to use in the query string.
|
||||
analyze_wildcard | Boolean | Whether the operation should include wildcard and prefix queries in the analysis. Default is false.
|
||||
conflicts | String | Specifies whether the operation should continue if the request runs into version conflicts. Valid options are `abort` and `proceed`. Default is `abort`.
|
||||
default_operator | String | The default operator the string query should use. Valid options are `AND` and `OR`. Default is `OR`.
|
||||
df | String | The default field when the query string does not have a field prefix.
|
||||
expand_wildcards | String | Specifies the type of index that wildcard expressions can match. Supports comma-separated values. Valid values are `all` (match any index), `open` (match open, non-hidden indices), `closed` (match closed, non-hidden indices), `hidden` (match hidden indices), and `none` (deny wildcard expressions). Default is `open`.
|
||||
from | Integer | The starting index to search from. Default is 0.
|
||||
ignore_unavailable | Boolean | Whether to exclude missing or closed indices in the response. Default is false.
|
||||
lenient | Boolean | Whether OpenSearch should ignore format-based query failures (for example, querying an integer field for a string). Default is false.
|
||||
max_docs | Integer | Maximum number of documents the request should process. Default is all documents.
|
||||
pipeline | String | ID of the pipeline to use to process documents.
|
||||
preference | String | The node or shard OpenSearch should perform the operation on.
|
||||
q | String | Query in the Lucene query string syntax.
|
||||
request_cache | Boolean | Whether OpenSearch should use the request cache for the operation. Default is whether it's enabled in the index's settings.
|
||||
refresh | Boolean | Specifies whether OpenSearch should refresh shards involved in the operation to make the operation visible to searching.
|
||||
requests_per_second | Integer | Specifies the request's throttling in sub-requests per second. Default is -1, which means no throttling.
|
||||
routing | String | Value used to route the operation to a specific shard.
|
||||
scroll | Time | How long to keep the search context open.
|
||||
scroll_size | Integer | Size of the operation's scroll request. Default is 1000.
|
||||
search_type | String | Whether OpenSearch should use global term and document frequencies calculating revelance scores. Valid choices are `query_then_fetch` and `dfs_query_then_fetch`. `query_then_fetch` scores documents using local term and document frequencies for the shard. It’s usually faster but less accurate. `dfs_query_then_fetch` scores documents using global term and document frequencies across all shards. It’s usually slower but more accurate. Default is `query_then_fetch`.
|
||||
search_timeout | Time | Amount of time until timeout for the search request. Default is no timeout.
|
||||
slices | Integer | Number of sub-tasks OpenSearch should divide this task into. Default is 1, which means OpenSearch should not divide this task.
|
||||
sort | String | A comma-separated list of <field> : <direction> pairs to sort by.
|
||||
_source | String | Whether to include the `_source` field in the response.
|
||||
_source_excludes | String | A comma-separated list of source fields to exclude from the response.
|
||||
_source_includes | String | A comma-separated list of source fields to include in the response.
|
||||
stats | String | Value to associate with the request for additional logging.
|
||||
terminate_after | Integer | The maximum number of documents OpenSearch should process before terminating the request.
|
||||
timeout | Time | How long the operation should wait from a response from active shards. Default is `1m`.
|
||||
version | Boolean | Whether to include the document version as a match.
|
||||
wait_for_active_shards | String | The number of shards that must be active before OpenSearch executes the operation. Valid values are `all` or any integer up to the total number of shards in the index. Default is 1, which is the primary shard.
|
||||
|
||||
## Request body
|
||||
|
||||
To update your indices and documents by query, you must include a [query]({{site.baseurl}}{{site.url}}/opensearch/query-dsl/index) and a script in the request body that OpenSearch can run to update your documents. If you don't specify a query, then every document in the index gets updated.
|
||||
|
||||
```json
|
||||
{
|
||||
"query": {
|
||||
"term": {
|
||||
"oldValue": 20
|
||||
}
|
||||
},
|
||||
"script" : {
|
||||
"source": "ctx._source.oldValue += params.newValue",
|
||||
"lang": "painless",
|
||||
"params" : {
|
||||
"newValue" : 10
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Response
|
||||
```json
|
||||
{
|
||||
"took": 21,
|
||||
"timed_out": false,
|
||||
"total": 1,
|
||||
"updated": 1,
|
||||
"deleted": 0,
|
||||
"batches": 1,
|
||||
"version_conflicts": 0,
|
||||
"noops": 0,
|
||||
"retries": {
|
||||
"bulk": 0,
|
||||
"search": 0
|
||||
},
|
||||
"throttled_millis": 0,
|
||||
"requests_per_second": -1.0,
|
||||
"throttled_until_millis": 0,
|
||||
"failures": []
|
||||
}
|
||||
```
|
||||
|
||||
## Response body fields
|
||||
|
||||
Field | Description
|
||||
:--- | :---
|
||||
took | The amount of time in milliseconds OpenSearch needed to complete the operation.
|
||||
timed_out | Whether any update requests during the operation timed out.
|
||||
total | Total number of documents processed.
|
||||
updated | Total number of documents updated.
|
||||
batches | Number of scroll responses the request processed.
|
||||
version_conflicts | Number of conflicts the request ran into.
|
||||
noops | How many update requests OpenSearch ignored during the operation. This field always returns 0.
|
||||
retries | The number of bulk and search retry requests.
|
||||
throttled_millis | Number of throttled milliseconds during the request.
|
||||
requests_per_second | Number of requests executed per second during the operation.
|
||||
throttled_until_millis | The amount of time until OpenSearch executes the next throttled request. Always equal to 0 in an update by query request.
|
||||
failures | Any failures that occur during the request.
|
||||
@@ -0,0 +1,126 @@
|
||||
---
|
||||
layout: default
|
||||
title: Update document
|
||||
parent: Document APIs
|
||||
grand_parent: REST API reference
|
||||
nav_order: 10
|
||||
---
|
||||
|
||||
# Update document
|
||||
Introduced 1.0
|
||||
{: .label .label-purple }
|
||||
|
||||
If you need to update a document's fields in your index, you can use the update document API operation. You can do so by specifying the new data you want in your index or by including a script in your request body, which OpenSearch runs to update the document.
|
||||
|
||||
## Example
|
||||
|
||||
```json
|
||||
POST /sample-index1/_update/1
|
||||
{
|
||||
"doc": {
|
||||
"first_name" : "Bruce",
|
||||
"last_name" : "Wayne"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Script example
|
||||
|
||||
```json
|
||||
POST /test-index1/_update/1
|
||||
{
|
||||
"script" : {
|
||||
"source": "ctx._source.oldValue += params.newValue",
|
||||
"lang": "painless",
|
||||
"params" : {
|
||||
"newValue" : 10
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
POST /<index-name>/_update/<_id>
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
Parameter | Type | Description | Required
|
||||
:--- | :--- | :--- | :---
|
||||
<index-name> | String | Name of the index. | Yes
|
||||
<_id> | String | The ID of the document to update. | Yes
|
||||
if_seq_no | Integer | Only perform the delete operation if the document's version number matches the specified number. | No
|
||||
if_primary_term | Integer | Only perform the delete operation if the document has the specified primary term. | No
|
||||
lang | String | Language of the script. Default is `painless`. | No
|
||||
require_alias | Boolean | Specifies whether the destination must be an index alias. Default is false. | No
|
||||
refresh | Enum | If true, OpenSearch refreshes shards to make the operation visible to searching. Valid options are `true`, `false`, and `wait_for`, which tells OpenSearch to wait for a refresh before executing the operation. Default is false. | No
|
||||
retry_on_conflict | Integer | The amount of times OpenSearch should retry the operation if there's a document conflict. Default is 0. | No
|
||||
routing | String | Value used to route the operation to a specific shard. | No
|
||||
_source | List | Whether to include the `_source` field in the response body. Default is true. | No
|
||||
_source_excludes | List | A comma-separated list of source fields to exclude in the query response. | No
|
||||
_source_includes | List | A comma-separated list of source fields to include in the query response. | No
|
||||
timeout | Time | How long to wait for a response from the cluster. | No
|
||||
wait_for_active_shards | String | The number of active shards that must be available before OpenSearch processes the update request. Default is 1 (only the primary shard). Set to `all` or a positive integer. Values greater than 1 require replicas. For example, if you specify a value of 3, the index must have two replicas distributed across two additional nodes for the operation to succeed. | No
|
||||
|
||||
## Request body
|
||||
|
||||
Your request body must contain the information you want to update your document with. If you just want to replace certain fields in your document, your request body must include a `doc` object, which has the fields you want to update.
|
||||
|
||||
```json
|
||||
{
|
||||
"doc": {
|
||||
"first_name": "Thomas",
|
||||
"last_name": "Wayne"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can also use a script to tell OpenSearch how to update your document.
|
||||
|
||||
```json
|
||||
{
|
||||
"script" : {
|
||||
"source": "ctx._source.oldValue += params.newValue",
|
||||
"lang": "painless",
|
||||
"params" : {
|
||||
"newValue" : 10
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Response
|
||||
```json
|
||||
{
|
||||
"_index": "sample-index1",
|
||||
"_type": "_doc",
|
||||
"_id": "1",
|
||||
"_version": 3,
|
||||
"result": "updated",
|
||||
"_shards": {
|
||||
"total": 2,
|
||||
"successful": 2,
|
||||
"failed": 0
|
||||
},
|
||||
"_seq_no": 4,
|
||||
"_primary_term": 17
|
||||
}
|
||||
```
|
||||
|
||||
## Response body fields
|
||||
|
||||
Field | Description
|
||||
:--- | :---
|
||||
_index | The name of the index.
|
||||
_type | The document's type. OpenSearch only supports one type, which is `_doc`.
|
||||
_id | The document's ID.
|
||||
_version | The document's version.
|
||||
_result | The result of the delete operation.
|
||||
_shards | Detailed information about the cluster's shards.
|
||||
total | The total number of shards.
|
||||
successful | The number of shards OpenSearch succssfully deleted the document from.
|
||||
failed | The number of shards OpenSearch failed to delete the document from.
|
||||
_seq_no | The sequence number assigned when the document was indexed.
|
||||
_primary_term | The primary term assigned when the document was indexed.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user