From f808ed3748d1b9f80c5707102b40fb468ce6366a Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 29 Feb 2024 14:42:21 -0800 Subject: [PATCH] [Bug][Discover] Allow saved sort from search embeddable to load in Dashboard (#5934) (#5938) Remove default sort to use saved search sort. Issue Resolve https://github.com/opensearch-project/OpenSearch-Dashboards/issues/5933 Signed-off-by: Anan Zhuang (cherry picked from commit 790c076fd4c8f38ade5482cede6d92d10792be54) Signed-off-by: github-actions[bot] # Conflicts: # CHANGELOG.md Co-authored-by: github-actions[bot] Co-authored-by: Qingyang(Abby) Hu --- .../discover/public/embeddable/search_embeddable.tsx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/plugins/discover/public/embeddable/search_embeddable.tsx b/src/plugins/discover/public/embeddable/search_embeddable.tsx index 79080cf8657f..e2c1b1271397 100644 --- a/src/plugins/discover/public/embeddable/search_embeddable.tsx +++ b/src/plugins/discover/public/embeddable/search_embeddable.tsx @@ -47,7 +47,6 @@ import { } from '../../../data/public'; import { Container, Embeddable } from '../../../embeddable/public'; import { ISearchEmbeddable, SearchInput, SearchOutput } from './types'; -import { getDefaultSort } from '../application/view_components/utils/get_default_sort'; import { getSortForSearchSource } from '../application/view_components/utils/get_sort_for_search_source'; import { getRequestInspectorStats, @@ -216,12 +215,6 @@ export class SearchEmbeddable return; } - const sort = getDefaultSort( - indexPattern, - this.services.uiSettings.get(SORT_DEFAULT_ORDER_SETTING, 'desc') - ); - this.savedSearch.sort = sort; - const searchProps: SearchProps = { columns: this.savedSearch.columns, sort: [],