Files
honeymoose f321dfedf5 同步完成!
**同步结果摘要**:

| 目录 | 同步前 | 同步后 | 官方 |
|------|--------|--------|------|
| aggregations | 40 | 65 | 64 |
| analyzers | 8 | 141 | 140 |
| api-reference | 97 | 186 | 174 |
| benchmark | 34 | 67 | 53 |
| clients | 17 | 18 | 18 |
| dashboards | 38 | 149 | 131 |
| data-prepper | 77 | 134 | 123 |
| im-plugin | 22 | 37 | 37 |
| ingest-pipelines | 27 | 52 | 51 |
| install-and-configure | 37 | 57 | 53 |
| ml-commons-plugin | 81 | 157 | 155 |
| observing-your-data | 39 | 73 | 66 |
| query-dsl | 40 | 77 | 75 |
| search-plugins | 80 | 139 | 95 |
| security-analytics | 22 | 47 | 46 |

**说明**:
- 本地文件数 > 官方:本地有一些官方已删除或重命名的文件
- 新增了约 **740 个英文文档文件**
- 已有文件保持不变(未覆盖)
2026-11-30 10:48:30 -05:00

4.6 KiB

layout, title, nav_order, redirect_from
layout title nav_order redirect_from
default Common operations 25
/benchmark/user-guide/understanding-workloads/common-operations/

Common operations

Test procedures use a variety of operations, found inside the operations directory of a workload. This page details the most common operations found inside OpenSearch Benchmark workloads.

bulk

The bulk operation type allows you to run bulk requests as a task.

The following example shows a bulk operation type with a bulk-size of 5000 documents:

{
  "name": "index-append",
  "operation-type": "bulk",
  "bulk-size": 5000
}

create-index

The create-index operation runs the Create Index API. It supports the following two modes of index creation:

  • Creating all indexes specified in the workloads indices section
  • Creating one specific index defined within the operation itself

The following example creates all indexes defined in the indices section of the workload. It uses all of the index settings defined in the workload but overrides the number of shards:

{
  "name": "create-all-indices",
  "operation-type": "create-index",
  "settings": {
    "index.number_of_shards": 1
  },
  "request-params": {
    "wait_for_active_shards": "true"
  }
}

The following example creates a new index with all index settings specified in the operation body:

{
  "name": "create-an-index",
  "operation-type": "create-index",
  "index": "people",
  "body": {
    "settings": {
      "index.number_of_shards": 0
    },
    "mappings": {
      "docs": {
        "properties": {
          "name": {
            "type": "text"
          }
        }
      }
    }
  }
}

delete-index

The delete-index operation runs the Delete Index API. Like with the create-index operation, you can delete all indexes found in the indices section of the workload or delete one or more indexes based on the string passed in the index setting.

The following example deletes all indexes found in the indices section of the workload:

{
  "name": "delete-all-indices",
  "operation-type": "delete-index"
}

The following example deletes all logs_* indexes:

{
  "name": "delete-logs",
  "operation-type": "delete-index",
  "index": "logs-*",
  "only-if-exists": false,
  "request-params": {
    "expand_wildcards": "all",
    "allow_no_indices": "true",
    "ignore_unavailable": "true"
  }
}

cluster-health

The cluster-health operation runs the Cluster Health API, which checks the cluster health status and returns the expected status according to the parameters set for request-params. If an unexpected cluster health status is returned, the operation reports a failure. You can use the --on-error option in the OpenSearch Benchmark run command to control how OpenSearch Benchmark behaves when the health check fails.

The following example creates a cluster-health operation that checks for a green health status on any log-* indexes:

{
  "name": "check-cluster-green",
  "operation-type": "cluster-health",
  "index": "logs-*",
  "request-params": {
    "wait_for_status": "green",
    "wait_for_no_relocating_shards": "true"
  },
  "retry-until-success": true
}

refresh

The refresh operation runs the Refresh API. The operation returns no metadata.

The following example refreshes all logs-* indexes:

{
 "name": "refresh",
 "operation-type": "refresh",
 "index": "logs-*"
}

The search operation runs the Search API, which you can use to run queries in OpenSearch Benchmark indexes.

The following example runs a match_all query inside the search operation:

{
  "name": "default",
  "operation-type": "search",
  "body": {
    "query": {
      "match_all": {}
    }
  },
  "request-params": {
    "_source_include": "some_field",
    "analyze_wildcard": "false"
  }
}