From 9d9c68b16c68ea6912b3e9088bddf762c723bce8 Mon Sep 17 00:00:00 2001 From: David Cui Date: Fri, 28 May 2021 10:38:05 -0700 Subject: [PATCH 1/2] revert .opensearch_dashboards index references to .kibana Signed-off-by: David Cui --- dashboards-reports/server/routes/reportSource.ts | 6 +++--- .../server/routes/utils/savedSearchReportHelper.ts | 6 +++--- dashboards-reports/server/utils/validationHelper.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dashboards-reports/server/routes/reportSource.ts b/dashboards-reports/server/routes/reportSource.ts index 1bdad11d..5edbaf6d 100644 --- a/dashboards-reports/server/routes/reportSource.ts +++ b/dashboards-reports/server/routes/reportSource.ts @@ -54,21 +54,21 @@ export default function (router: IRouter) { let responseParams; if (request.params.reportSourceType === 'dashboard') { const params: RequestParams.Search = { - index: '.opensearch_dashboards', + index: '.kibana', q: 'type:dashboard', size: DEFAULT_MAX_SIZE, }; responseParams = params; } else if (request.params.reportSourceType === 'visualization') { const params: RequestParams.Search = { - index: '.opensearch_dashboards', + index: '.kibana', q: 'type:visualization', size: DEFAULT_MAX_SIZE, }; responseParams = params; } else if (request.params.reportSourceType === 'search') { const params: RequestParams.Search = { - index: '.opensearch_dashboards', + index: '.kibana', q: 'type:search', size: DEFAULT_MAX_SIZE, }; diff --git a/dashboards-reports/server/routes/utils/savedSearchReportHelper.ts b/dashboards-reports/server/routes/utils/savedSearchReportHelper.ts index 6b839917..140f38ac 100644 --- a/dashboards-reports/server/routes/utils/savedSearchReportHelper.ts +++ b/dashboards-reports/server/routes/utils/savedSearchReportHelper.ts @@ -89,7 +89,7 @@ async function populateMetaData( // Get saved search info let resIndexPattern: any = {}; const ssParams = { - index: '.opensearch_dashboards', + index: '.kibana', id: 'search:' + metaData.saved_search_id, }; const ssInfos = await callCluster(client, 'get', ssParams, isScheduledTask); @@ -97,7 +97,7 @@ async function populateMetaData( metaData.sorting = ssInfos._source.search.sort; metaData.type = ssInfos._source.type; metaData.filters = - ssInfos._source.search.opensearchDashboardsSavedObjectMeta.searchSourceJSON; + ssInfos._source.search.kibanaSavedObjectMeta.searchSourceJSON; // Get the list of selected columns in the saved search.Otherwise select all the fields under the _source await getSelectedFields(ssInfos._source.search.columns); @@ -110,7 +110,7 @@ async function populateMetaData( client, 'get', { - index: '.opensearch_dashboards', + index: '.kibana', id: 'index-pattern:' + item.id, }, isScheduledTask diff --git a/dashboards-reports/server/utils/validationHelper.ts b/dashboards-reports/server/utils/validationHelper.ts index 387f9d0a..26632e0c 100644 --- a/dashboards-reports/server/utils/validationHelper.ts +++ b/dashboards-reports/server/utils/validationHelper.ts @@ -137,7 +137,7 @@ const validateSavedObject = async ( else { savedObjectId = `${getType(source)}:${getId(url)}`; const params: RequestParams.Exists = { - index: '.opensearch_dashboards', + index: '.kibana', id: savedObjectId, }; exist = await client.callAsCurrentUser('exists', params); From 9e5477de5e41eba8df2b8d673ea865714c0ed7f9 Mon Sep 17 00:00:00 2001 From: David Cui Date: Fri, 28 May 2021 10:55:37 -0700 Subject: [PATCH 2/2] update reference in test cases Signed-off-by: David Cui --- .../routes/utils/__tests__/savedSearchReportHelper.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dashboards-reports/server/routes/utils/__tests__/savedSearchReportHelper.test.ts b/dashboards-reports/server/routes/utils/__tests__/savedSearchReportHelper.test.ts index f1ca9b8a..26600fff 100644 --- a/dashboards-reports/server/routes/utils/__tests__/savedSearchReportHelper.test.ts +++ b/dashboards-reports/server/routes/utils/__tests__/savedSearchReportHelper.test.ts @@ -399,13 +399,13 @@ function mockSavedSearch(columns = '"category", "customer_gender"') { "columns": [ ${columns} ], "sort": [], "version": 1, - "opensearchDashboardsSavedObjectMeta": { - "searchSourceJSON": "{\\"highlightAll\\":true,\\"version\\":true,\\"query\\":{\\"query\\":\\"\\",\\"language\\":\\"kuery\\"},\\"indexRefName\\":\\"opensearchDashboardsSavedObjectMeta.searchSourceJSON.index\\",\\"filter\\":[]}" + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\\"highlightAll\\":true,\\"version\\":true,\\"query\\":{\\"query\\":\\"\\",\\"language\\":\\"kuery\\"},\\"indexRefName\\":\\"kibanaSavedObjectMeta.searchSourceJSON.index\\",\\"filter\\":[]}" } }, "references": [ { - "name": "opensearchDashboardsSavedObjectMeta.searchSourceJSON.index", + "name": "kibanaSavedObjectMeta.searchSourceJSON.index", "type": "index-pattern", "id": "ff959d40-b880-11e8-a6d9-e546fe2bba5f" }