From 349434ed040bb558552acbfe2b7686f65a81c77f Mon Sep 17 00:00:00 2001 From: Joe Portner <5295965+jportner@users.noreply.github.com> Date: Tue, 16 Nov 2021 08:51:22 -0500 Subject: [PATCH] Fix cluster call responses that are missing source fields (#118642) Change usage from `_source: 'true'` to `_source: true`. --- .../src/lib/docs/generate_doc_records_stream.test.ts | 4 ++-- .../src/lib/docs/generate_doc_records_stream.ts | 2 +- src/core/server/saved_objects/service/lib/repository.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/kbn-es-archiver/src/lib/docs/generate_doc_records_stream.test.ts b/packages/kbn-es-archiver/src/lib/docs/generate_doc_records_stream.test.ts index 3b5f1f777b0e3..ae21649690a99 100644 --- a/packages/kbn-es-archiver/src/lib/docs/generate_doc_records_stream.test.ts +++ b/packages/kbn-es-archiver/src/lib/docs/generate_doc_records_stream.test.ts @@ -121,7 +121,7 @@ describe('esArchiver: createGenerateDocRecordsStream()', () => { "calls": Array [ Array [ Object { - "_source": "true", + "_source": true, "index": "bar", "query": undefined, "rest_total_hits_as_int": true, @@ -136,7 +136,7 @@ describe('esArchiver: createGenerateDocRecordsStream()', () => { ], Array [ Object { - "_source": "true", + "_source": true, "index": "foo", "query": undefined, "rest_total_hits_as_int": true, diff --git a/packages/kbn-es-archiver/src/lib/docs/generate_doc_records_stream.ts b/packages/kbn-es-archiver/src/lib/docs/generate_doc_records_stream.ts index 4bd44b649afd2..b1b713f6f3cbf 100644 --- a/packages/kbn-es-archiver/src/lib/docs/generate_doc_records_stream.ts +++ b/packages/kbn-es-archiver/src/lib/docs/generate_doc_records_stream.ts @@ -38,7 +38,7 @@ export function createGenerateDocRecordsStream({ index, scroll: SCROLL_TIMEOUT, size: SCROLL_SIZE, - _source: 'true', + _source: true, query, rest_total_hits_as_int: true, }, diff --git a/src/core/server/saved_objects/service/lib/repository.ts b/src/core/server/saved_objects/service/lib/repository.ts index d538690fb1920..9be58f1b71861 100644 --- a/src/core/server/saved_objects/service/lib/repository.ts +++ b/src/core/server/saved_objects/service/lib/repository.ts @@ -1825,7 +1825,7 @@ export class SavedObjectsRepository { index: this.getIndexForType(type), refresh, require_alias: true, - _source: 'true', + _source: true, body: { script: { source: `