[8.10] [DOCS] Remove Upgrade Assistant add default field API (#217264) (#217394)

# Backport

This will backport the following commits from `8.x` to `8.10`:
- [[DOCS] Remove Upgrade Assistant add default field API
(#217264)](https://github.com/elastic/kibana/pull/217264)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Lisa
Cawley","email":"lcawley@elastic.co"},"sourceCommit":{"committedDate":"2025-04-07T16:31:35Z","message":"[DOCS]
Remove Upgrade Assistant add default field API
(#217264)","sha":"0391d970dbbcf402a7b4f469f4be908921604b76","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Docs","release_note:skip","docs","v7.13.5","v7.14.3","v7.15.3","v7.16.4","v8.0.2","v8.1.4","v8.2.4","v8.3.4","v8.4.4","v8.5.4","v8.6.3","v8.7.2","v8.8.3","v8.9.3","v8.10.5","v7.17.17","v8.11.5","v8.12.3","v8.13.5","v8.14.4","backport:version","v8.15.6","v8.19.0","v8.18.1","v8.17.5","v8.16.7"],"title":"[DOCS]
Remove Upgrade Assistant add default field API
","number":217264,"url":"https://github.com/elastic/kibana/pull/217264","mergeCommit":{"message":"[DOCS]
Remove Upgrade Assistant add default field API
(#217264)","sha":"0391d970dbbcf402a7b4f469f4be908921604b76"}},"sourceBranch":"8.x","suggestedTargetBranches":["7.13","7.14","7.15","7.16","8.0","8.1","8.2","8.3","8.4","8.5","8.6","8.7","8.8","8.9","8.10","7.17","8.11","8.12","8.13","8.14","8.15","8.18","8.17","8.16"],"targetPullRequestStates":[{"branch":"7.13","label":"v7.13.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"7.14","label":"v7.14.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"7.15","label":"v7.15.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"7.16","label":"v7.16.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.0","label":"v8.0.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.1","label":"v8.1.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.2","label":"v8.2.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.3","label":"v8.3.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.4","label":"v8.4.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.5","label":"v8.5.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.6","label":"v8.6.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.7","label":"v8.7.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.8","label":"v8.8.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.9","label":"v8.9.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.10","label":"v8.10.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"7.17","label":"v7.17.17","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.11","label":"v8.11.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.12","label":"v8.12.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.13","label":"v8.13.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.14","label":"v8.14.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.15","label":"v8.15.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.7","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
This commit is contained in:
Lisa Cawley 2025-04-08 12:49:18 -07:00 committed by GitHub
parent 201bcfaa19
commit 248fcc5ce7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 439 additions and 114 deletions

View file

@ -22,6 +22,5 @@ include::upgrade-assistant/status.asciidoc[]
include::upgrade-assistant/reindexing.asciidoc[]
include::upgrade-assistant/batch_reindexing.asciidoc[]
include::upgrade-assistant/batch_queue.asciidoc[]
include::upgrade-assistant/default-field.asciidoc[]
include::upgrade-assistant/check_reindex_status.asciidoc[]
include::upgrade-assistant/cancel_reindex.asciidoc[]

View file

@ -1,113 +0,0 @@
[[upgrade-assistant-api-default-field]]
=== Add default field API
++++
<titleabbrev>Add default field</titleabbrev>
++++
experimental[] In {es} 7.0 and later, some query types, such as Simple Query String, have a limit to the number of fields they can query against.
To configure the cap in {es}, set the `indices.query.bool.max_clause_count` cluster setting, which is 1024 by default.
For indices with more fields than the cap, add the `index.query.default_field` index setting to inform {es} which
fields to use by default when no field is specified for a query. Use the add default field API to add the `index.query.default_field` setting to an {es} index.
[[upgrade-assistant-api-default-field-request]]
==== Request
To add the `index.query.default_field` setting to an {es} index, submit a POST request to `/api/upgrade_assistant/add_query_default_field/<index>`:
[source,js]
--------------------------------------------------
GET /api/upgrade_assistant/add_query_default_field/myIndex
{
"fieldTypes": ["text", "keyword"], <1>
"otherFields": ["myField.*"] <2>
}
--------------------------------------------------
// KIBANA
<1> A required array of {es} field types that generate the list of fields.
<2> An optional array of additional field names, dot-delimited.
To add the `index.query.default_field` index setting to the specified index, {kib} generates an array of all fields from the index mapping.
The fields contain the types specified in `fieldTypes`. {kib} appends any other fields specified in `otherFields` to the array of default fields.
[[upgrade-assistant-api-default-field-response-codes]]
==== Response codes
`200`::
Indicates a successful call.
`400`::
Indicates that the index already has the `index.query.default_field` setting. No changes are made to the index.
[[upgrade-assistant-api-default-field-response-body]]
==== Response body
The response body contains a JSON structure, similar to the following:
[source,js]
--------------------------------------------------
{
"acknowledged": true
}
--------------------------------------------------
[[upgrade-assistant-api-default-field-example]]
==== Example
Your index contains following mappings:
[source,js]
--------------------------------------------------
GET /myIndex/_mappings
{
"myIndex": {
"mappings": {
"properties": {
"field1": { "type": "text" },
"field2": { "type": "float" },
"nestedfield": {
"properties": {
"field3": { "type": "keyword" },
"field4": { "type": "long" },
}
}
}
}
}
}
--------------------------------------------------
// CONSOLE
Make the following request to {kib}:
[source,js]
--------------------------------------------------
GET /api/upgrade_assistant/add_query_default_field/myIndex
{
"fieldTypes": ["text", "long"],
"otherFields": ["field2"]
}
--------------------------------------------------
// KIBANA
The API returns the following:
[source,js]
--------------------------------------------------
GET /myIndex/_settings?flat_settings=true
{
"myIndex": {
"settings": {
"index.query.default_field": [
"field1",
"nestedfield.field4",
"field2",
]
}
}
}
--------------------------------------------------
// CONSOLE
{kib} generates the `field1` and `nestedfield.field4` values based on the specified `fieldTypes`, then appends the `otherFields` to the array.

View file

@ -428,3 +428,8 @@ This content has moved. Refer to <<enhancements-and-bug-fixes-v8.10.0-revised>>
For the most up-to-date API details, refer to the
{kib-repo}/tree/{branch}/x-pack/plugins/alerting/docs/openapi[alerting], {kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[cases], {kib-repo}/tree/{branch}/x-pack/plugins/actions/docs/openapi[connectors], and {kib-repo}/tree/{branch}/x-pack/plugins/ml/common/openapi[machine learning] open API specifications.
[role="exclude",id="upgrade-assistant-api-default-field"]
== Add default field API
This API was removed in 7.13.0. Refer to <<upgrade-assistant-api>>.

View file

@ -0,0 +1,434 @@
openapi: 3.0.3
info:
title: Upgrade assistant APIs
description: Kibana APIs for the upgrade assistant feature
version: "1.0.0"
license:
name: Elastic License 2.0
url: https://www.elastic.co/licensing/elastic-license
tags:
- name: upgrade
description: Check the upgrade status of your Elasticsearch cluster and reindex indices that were created in the previous major version. The assistant helps you prepare for the next major version of Elasticsearch.
x-displayName: Upgrade assistant
servers:
- url: /
paths:
/api/upgrade_assistant/status:
get:
summary: Get the upgrade readiness status
description: Check the status of your cluster.
x-state: Technical Preview
operationId: get-upgrade-status
tags:
- upgrade
responses:
'200':
description: Indicates a successful call.
content:
application/json:
examples:
getUpgradeStatusResponseExample1:
value: |-
{
"readyForUpgrade": false,
"cluster": [
{
"message": "Cluster deprecated issue",
"details":"You have 2 system indices that must be migrated and 5 Elasticsearch deprecation issues and 0 Kibana deprecation issues that must be resolved before upgrading."
}
]
}
/api/upgrade_assistant/reindex/{index}:
get:
summary: Get the reindex status
description: >
Check the status of the reindex task.
x-state: Technical Preview
operationId: get-upgrade-reindex
tags:
- upgrade
parameters:
- in: path
name: index
description: The name of the index that is reindexing.
required: true
schema:
type: string
responses:
'200':
description: Indicates a successful call.
content:
application/json:
schema:
type: object
properties:
hasRequiredPrivileges:
type: boolean
description: >
Specifies whether the user has sufficient privileges to reindex this index.
When security is unavailable or disabled, it is `true`.
reindexOp:
type: object
properties:
errorMessage:
$ref: '#/components/schemas/errorMessage'
indexName:
$ref: '#/components/schemas/indexName'
lastCompletedStep:
$ref: '#/components/schemas/lastCompletedStep'
newIndexName:
$ref: '#/components/schemas/newIndexName'
reindexTaskId:
$ref: '#/components/schemas/reindexTaskId'
reindexTaskPercComplete:
$ref: '#/components/schemas/reindexTaskPercComplete'
status:
$ref: '#/components/schemas/status'
warnings:
type: array
description: >
An array of any warning codes that explain what changes are required for this reindex.
For example:
- `0` specifies to remove the `_all` meta field.
- `1` specifies to convert any coerced boolean values in the source document. For example, `yes`, `1`, and `off`.
- `2` specifies to convert documents to support Elastic Common Schema. Applies only to APM indices created in 6.x.
examples:
getUpgradeReindexResponseExample1:
value: |-
{
"reindexOp": {
"indexName": ".ml-state",
"newIndexName": ".reindexed-v7-ml-state",
"status": 0,
"lastCompletedStep": 40,
"reindexTaskId": "QprwvTMzRQ2MLWOW22oQ4Q:11819",
"reindexTaskPercComplete": 0.3,
"errorMessage": null
},
"warnings": [],
"hasRequiredPrivileges": true
}
post:
summary: Start or resume reindexing
description: |
Start a new reindex or resume a paused reindex.
The following steps are performed during a reindex task:
1. Set the index to read-only.
1. Create a new index.
1. Reindex documents into the new index.
1. Create an index alias for the new index.
1. Delete the old index.
x-state: Technical Preview
operationId: start-upgrade-reindex
tags:
- upgrade
parameters:
- in: path
name: index
description: The name of the index to reindex.
required: true
schema:
type: string
responses:
'200':
description: Indicates a successful call.
content:
application/json:
schema:
type: object
properties:
errorMessage:
$ref: '#/components/schemas/errorMessage'
indexName:
$ref: '#/components/schemas/indexName'
lastCompletedStep:
$ref: '#/components/schemas/lastCompletedStep'
newIndexName:
$ref: '#/components/schemas/newIndexName'
reindexTaskId:
$ref: '#/components/schemas/reindexTaskId'
reindexTaskPercComplete:
$ref: '#/components/schemas/reindexTaskPercComplete'
status:
$ref: '#/components/schemas/status'
examples:
startUpgradeReindexResponseExample1:
value: |-
{
"indexName": ".ml-state",
"newIndexName": ".reindexed-v7-ml-state",
"status": 0,
"lastCompletedStep": 0,
"reindexTaskId": null,
"reindexTaskPercComplete": null,
"errorMessage": null
}
/api/upgrade_assistant/reindex/{index}/cancel:
post:
summary: Cancel reindexing
description: >
Cancel reindexes that are waiting for the Elasticsearch reindex task to complete.
For example, cancel reindexing if the `lastCompletedStep` has the value `40`.
x-state: Technical Preview
operationId: cancel-upgrade-reindex
tags:
- upgrade
parameters:
- in: path
name: index
description: The name of the index that was reindexing.
required: true
schema:
type: string
responses:
'200':
description: Indicates a successful call.
content:
application/json:
schema:
type: object
properties:
acknowledged:
type: boolean
# description:
examples:
cancelUpgradeReindexResponseExample1:
value: |-
{
"acknowledged": true
}
/api/upgrade_assistant/reindex/batch:
post:
summary: Batch start or resume reindexing
description: >
Start or resume multiple reindexing tasks in one request.
Additionally, reindexing tasks started or resumed via the batch endpoint will be placed on a queue and run one-by-one, which ensures that minimal cluster resources are consumed over time.
x-state: Technical Preview
operationId: batch-start-upgrade-reindex
tags:
- upgrade
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- indexNames
properties:
indexNames:
type: array
items:
type: string
description: >
The list of index names to be reindexed.
The order of the indices determines the order that the reindex tasks are run.
responses:
'200':
description: Indicates a successful call.
content:
application/json:
schema:
type: object
properties:
enqueued:
type: array
description: >
A list of reindex tasks created.
The order in the array indicates the order in which tasks will be run.
items:
type: object
properties:
errorMessage:
$ref: '#/components/schemas/errorMessage'
indexName:
$ref: '#/components/schemas/indexName'
lastCompletedStep:
$ref: '#/components/schemas/lastCompletedStep'
locked:
$ref: '#/components/schemas/locked'
reindexOptions:
$ref: '#/components/schemas/reindexOptions'
reindexTaskId:
$ref: '#/components/schemas/reindexTaskId'
reindexTaskPercComplete:
$ref: '#/components/schemas/reindexTaskPercComplete'
runningReindexCount:
$ref: '#/components/schemas/runningReindexCount'
errors:
type: array
description: >
A list of errors that may have occurred preventing the reindex task from being created.
items:
- type: object
examples:
batchStartUpgradeReindexResponseExample1:
value: |-
{
"enqueued": [
{
"indexName": "index1",
"newIndexName": "reindexed-v8-index1",
"status": 3,
"lastCompletedStep": 0,
"locked": null,
"reindexTaskId": null,
"reindexTaskPercComplete": null,
"errorMessage": null,
"runningReindexCount": null,
"reindexOptions": {
"queueSettings": {
"queuedAt": 1583406985489
}
}
}
],
"errors": [
{
"indexName": "index2",
"message": "Something went wrong!"
}
]
}
/api/upgrade_assistant/reindex/batch/queue:
get:
summary: Get the batch reindex queue
description: >
Check the current reindex batch queue.
x-state: Technical Preview
operationId: get-batch-upgrade-reindex
tags:
- upgrade
responses:
'200':
description: Indicates a successful call.
content:
application/json:
schema:
type: object
properties:
queue:
type: array
description: >
Items in this array indicate reindex tasks at a given point in time and the order in which they will be run.
items:
type: object
properties:
errorMessage:
$ref: '#/components/schemas/errorMessage'
indexName:
$ref: '#/components/schemas/indexName'
lastCompletedStep:
$ref: '#/components/schemas/lastCompletedStep'
locked:
$ref: '#/components/schemas/locked'
reindexOptions:
$ref: '#/components/schemas/reindexOptions'
reindexTaskId:
$ref: '#/components/schemas/reindexTaskId'
reindexTaskPercComplete:
$ref: '#/components/schemas/reindexTaskPercComplete'
runningReindexCount:
$ref: '#/components/schemas/runningReindexCount'
examples:
getBatchUpgradeReindexResponseExample1:
value: |-
{
"queue": [
{
"indexName": "index1",
"newIndexName": "reindexed-v8-index2",
"status": 3,
"lastCompletedStep": 0,
"locked": null,
"reindexTaskId": null,
"reindexTaskPercComplete": null,
"errorMessage": null,
"runningReindexCount": null,
"reindexOptions": {
"queueSettings": {
"queuedAt": 1583406985489
}
}
},
{
"indexName": "index2",
"newIndexName": "reindexed-v8-index2",
"status": 3,
"lastCompletedStep": 0,
"locked": null,
"reindexTaskId": null,
"reindexTaskPercComplete": null,
"errorMessage": null,
"runningReindexCount": null,
"reindexOptions": {
"queueSettings": {
"queuedAt": 1583406987334
}
}
}
]
}
components:
schemas:
errorMessage:
type: string
description: The error that caused the reindex to fail, if it failed.
indexName:
type: string
description: The name of the old index.
lastCompletedStep:
type: integer
description: >
The last successfully completed step of the reindex. For example:
- `0`: The reindex task has been created in Kibana.
- `10`: The index group services stopped. Only applies to some system indices.
- `20`: The index is set to readonly.
- `30`: The new destination index has been created.
- `40`: The reindex task in Elasticsearch has started.
- `50`: The reindex task in Elasticsearch has completed.
- `60`: Aliases were created to point to the new index, and the old index has been deleted.
- `70`: The index group services have resumed. Only applies to some system indices.
locked:
type: string
# description: TBD
newIndexName:
type: string
description: The name of the new index.
reindexOptions:
type: object
description: The presence of this key indicates that the reindex job will occur in the batch.
properties:
queueSettings:
type: object
# description: TBD
properties:
queuedAt:
type: number
description: A Unix timestamp of when the reindex task was placed in the queue.
reindexTaskId:
type: string
description: >
The task ID of the reindex task in Elasticsearch.
This value appears when the reindexing starts.
reindexTaskPercComplete:
type: number
description: >
The progress of the reindexing task in Elasticsearch.
It appears in decimal form, from 0 to 1.
runningReindexCount:
type: number
# description: TBD
status:
type: integer
description: >
The reindex status. For example:
- `0`: In progress
- `1`: Completed
- `2`: Failed
- `3`: Paused