From 9896a8a53edb9b722f84aabaa50e40f1e35a4ef6 Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Tue, 14 Jul 2020 15:14:17 -0700 Subject: [PATCH] Fix mappings for Upgrade Assistant reindexOperationSavedObjectType. (#71710) (#71743) --- .../reindex_operation_saved_object_type.ts | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/upgrade_assistant/server/saved_object_types/reindex_operation_saved_object_type.ts b/x-pack/plugins/upgrade_assistant/server/saved_object_types/reindex_operation_saved_object_type.ts index ba661fbeceb26..d8976cf19f7e8 100644 --- a/x-pack/plugins/upgrade_assistant/server/saved_object_types/reindex_operation_saved_object_type.ts +++ b/x-pack/plugins/upgrade_assistant/server/saved_object_types/reindex_operation_saved_object_type.ts @@ -15,13 +15,25 @@ export const reindexOperationSavedObjectType: SavedObjectsType = { mappings: { properties: { reindexTaskId: { - type: 'keyword', + type: 'text', + fields: { + keyword: { + type: 'keyword', + ignore_above: 256, + }, + }, }, indexName: { type: 'keyword', }, newIndexName: { - type: 'keyword', + type: 'text', + fields: { + keyword: { + type: 'keyword', + ignore_above: 256, + }, + }, }, status: { type: 'integer', @@ -30,10 +42,19 @@ export const reindexOperationSavedObjectType: SavedObjectsType = { type: 'date', }, lastCompletedStep: { - type: 'integer', + type: 'long', }, + // Note that reindex failures can result in extremely long error messages coming from ES. + // We need to map these errors as text and use ignore_above to prevent indexing really large + // messages as keyword. See https://github.com/elastic/kibana/issues/71642 for more info. errorMessage: { - type: 'keyword', + type: 'text', + fields: { + keyword: { + type: 'keyword', + ignore_above: 256, + }, + }, }, reindexTaskPercComplete: { type: 'float',