diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.cancelsession.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.cancelsession.md
new file mode 100644
index 000000000000..3b38e64ecc3d
--- /dev/null
+++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.cancelsession.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IScopedSearchClient](./kibana-plugin-plugins-data-server.iscopedsearchclient.md) > [cancelSession](./kibana-plugin-plugins-data-server.iscopedsearchclient.cancelsession.md)
+
+## IScopedSearchClient.cancelSession property
+
+Signature:
+
+```typescript
+cancelSession: IScopedSearchSessionsClient['cancel'];
+```
diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.deletesession.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.deletesession.md
new file mode 100644
index 000000000000..609c730c2911
--- /dev/null
+++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.deletesession.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IScopedSearchClient](./kibana-plugin-plugins-data-server.iscopedsearchclient.md) > [deleteSession](./kibana-plugin-plugins-data-server.iscopedsearchclient.deletesession.md)
+
+## IScopedSearchClient.deleteSession property
+
+Signature:
+
+```typescript
+deleteSession: IScopedSearchSessionsClient['delete'];
+```
diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.extendsession.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.extendsession.md
new file mode 100644
index 000000000000..33ce8f2a82d0
--- /dev/null
+++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.extendsession.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IScopedSearchClient](./kibana-plugin-plugins-data-server.iscopedsearchclient.md) > [extendSession](./kibana-plugin-plugins-data-server.iscopedsearchclient.extendsession.md)
+
+## IScopedSearchClient.extendSession property
+
+Signature:
+
+```typescript
+extendSession: IScopedSearchSessionsClient['extend'];
+```
diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.findsessions.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.findsessions.md
new file mode 100644
index 000000000000..2a78e09841e7
--- /dev/null
+++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.findsessions.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IScopedSearchClient](./kibana-plugin-plugins-data-server.iscopedsearchclient.md) > [findSessions](./kibana-plugin-plugins-data-server.iscopedsearchclient.findsessions.md)
+
+## IScopedSearchClient.findSessions property
+
+Signature:
+
+```typescript
+findSessions: IScopedSearchSessionsClient['find'];
+```
diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.getsession.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.getsession.md
new file mode 100644
index 000000000000..4afcf4ad2919
--- /dev/null
+++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.getsession.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IScopedSearchClient](./kibana-plugin-plugins-data-server.iscopedsearchclient.md) > [getSession](./kibana-plugin-plugins-data-server.iscopedsearchclient.getsession.md)
+
+## IScopedSearchClient.getSession property
+
+Signature:
+
+```typescript
+getSession: IScopedSearchSessionsClient['get'];
+```
diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.md
new file mode 100644
index 000000000000..41ac662905b6
--- /dev/null
+++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.md
@@ -0,0 +1,24 @@
+
+
+[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IScopedSearchClient](./kibana-plugin-plugins-data-server.iscopedsearchclient.md)
+
+## IScopedSearchClient interface
+
+Signature:
+
+```typescript
+export interface IScopedSearchClient extends ISearchClient
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [cancelSession](./kibana-plugin-plugins-data-server.iscopedsearchclient.cancelsession.md) | IScopedSearchSessionsClient['cancel']
| |
+| [deleteSession](./kibana-plugin-plugins-data-server.iscopedsearchclient.deletesession.md) | IScopedSearchSessionsClient['delete']
| |
+| [extendSession](./kibana-plugin-plugins-data-server.iscopedsearchclient.extendsession.md) | IScopedSearchSessionsClient['extend']
| |
+| [findSessions](./kibana-plugin-plugins-data-server.iscopedsearchclient.findsessions.md) | IScopedSearchSessionsClient['find']
| |
+| [getSession](./kibana-plugin-plugins-data-server.iscopedsearchclient.getsession.md) | IScopedSearchSessionsClient['get']
| |
+| [saveSession](./kibana-plugin-plugins-data-server.iscopedsearchclient.savesession.md) | IScopedSearchSessionsClient['save']
| |
+| [updateSession](./kibana-plugin-plugins-data-server.iscopedsearchclient.updatesession.md) | IScopedSearchSessionsClient['update']
| |
+
diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.savesession.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.savesession.md
new file mode 100644
index 000000000000..78cd49c37600
--- /dev/null
+++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.savesession.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IScopedSearchClient](./kibana-plugin-plugins-data-server.iscopedsearchclient.md) > [saveSession](./kibana-plugin-plugins-data-server.iscopedsearchclient.savesession.md)
+
+## IScopedSearchClient.saveSession property
+
+Signature:
+
+```typescript
+saveSession: IScopedSearchSessionsClient['save'];
+```
diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.updatesession.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.updatesession.md
new file mode 100644
index 000000000000..5e010f9168e4
--- /dev/null
+++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.iscopedsearchclient.updatesession.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [IScopedSearchClient](./kibana-plugin-plugins-data-server.iscopedsearchclient.md) > [updateSession](./kibana-plugin-plugins-data-server.iscopedsearchclient.updatesession.md)
+
+## IScopedSearchClient.updateSession property
+
+Signature:
+
+```typescript
+updateSession: IScopedSearchSessionsClient['update'];
+```
diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.md
index fd9ed1e8f635..e0734bc017f4 100644
--- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.md
+++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.md
@@ -52,6 +52,7 @@
| [IFieldSubType](./kibana-plugin-plugins-data-server.ifieldsubtype.md) | |
| [IFieldType](./kibana-plugin-plugins-data-server.ifieldtype.md) | |
| [IndexPatternAttributes](./kibana-plugin-plugins-data-server.indexpatternattributes.md) | Interface for an index pattern saved object |
+| [IScopedSearchClient](./kibana-plugin-plugins-data-server.iscopedsearchclient.md) | |
| [ISearchOptions](./kibana-plugin-plugins-data-server.isearchoptions.md) | |
| [ISearchSessionService](./kibana-plugin-plugins-data-server.isearchsessionservice.md) | |
| [ISearchSetup](./kibana-plugin-plugins-data-server.isearchsetup.md) | |
diff --git a/src/plugins/data/server/index.ts b/src/plugins/data/server/index.ts
index 2a21b9e43459..cbf09ef57d96 100644
--- a/src/plugins/data/server/index.ts
+++ b/src/plugins/data/server/index.ts
@@ -220,6 +220,7 @@ export {
} from '../common';
export {
+ IScopedSearchClient,
ISearchStrategy,
ISearchSetup,
ISearchStart,
diff --git a/src/plugins/data/server/server.api.md b/src/plugins/data/server/server.api.md
index f755679405de..0118906c181c 100644
--- a/src/plugins/data/server/server.api.md
+++ b/src/plugins/data/server/server.api.md
@@ -963,6 +963,29 @@ export class IndexPatternsServiceProvider implements Plugin_3 {
- // Warning: (ae-forgotten-export) The symbol "IScopedSearchSessionsClient" needs to be exported by the entry point index.d.ts
- //
// (undocumented)
asScopedProvider: (core: CoreStart) => (request: KibanaRequest) => IScopedSearchSessionsClient;
}
@@ -1010,8 +1031,6 @@ export interface ISearchStart IScopedSearchClient;
getSearchStrategy: (name?: string) => ISearchStrategy;
@@ -1481,20 +1500,20 @@ export function usageProvider(core: CoreSetup_2): SearchUsage;
// src/plugins/data/server/index.ts:101:26 - (ae-forgotten-export) The symbol "HistogramFormat" needs to be exported by the entry point index.d.ts
// src/plugins/data/server/index.ts:128:27 - (ae-forgotten-export) The symbol "isFilterable" needs to be exported by the entry point index.d.ts
// src/plugins/data/server/index.ts:128:27 - (ae-forgotten-export) The symbol "isNestedField" needs to be exported by the entry point index.d.ts
-// src/plugins/data/server/index.ts:243:20 - (ae-forgotten-export) The symbol "getRequestInspectorStats" needs to be exported by the entry point index.d.ts
-// src/plugins/data/server/index.ts:243:20 - (ae-forgotten-export) The symbol "getResponseInspectorStats" needs to be exported by the entry point index.d.ts
-// src/plugins/data/server/index.ts:243:20 - (ae-forgotten-export) The symbol "tabifyAggResponse" needs to be exported by the entry point index.d.ts
-// src/plugins/data/server/index.ts:243:20 - (ae-forgotten-export) The symbol "tabifyGetColumns" needs to be exported by the entry point index.d.ts
-// src/plugins/data/server/index.ts:245:1 - (ae-forgotten-export) The symbol "CidrMask" needs to be exported by the entry point index.d.ts
-// src/plugins/data/server/index.ts:246:1 - (ae-forgotten-export) The symbol "dateHistogramInterval" needs to be exported by the entry point index.d.ts
-// src/plugins/data/server/index.ts:255:1 - (ae-forgotten-export) The symbol "InvalidEsCalendarIntervalError" needs to be exported by the entry point index.d.ts
-// src/plugins/data/server/index.ts:256:1 - (ae-forgotten-export) The symbol "InvalidEsIntervalFormatError" needs to be exported by the entry point index.d.ts
-// src/plugins/data/server/index.ts:257:1 - (ae-forgotten-export) The symbol "Ipv4Address" needs to be exported by the entry point index.d.ts
-// src/plugins/data/server/index.ts:261:1 - (ae-forgotten-export) The symbol "isValidEsInterval" needs to be exported by the entry point index.d.ts
-// src/plugins/data/server/index.ts:262:1 - (ae-forgotten-export) The symbol "isValidInterval" needs to be exported by the entry point index.d.ts
-// src/plugins/data/server/index.ts:266:1 - (ae-forgotten-export) The symbol "propFilter" needs to be exported by the entry point index.d.ts
-// src/plugins/data/server/index.ts:269:1 - (ae-forgotten-export) The symbol "toAbsoluteDates" needs to be exported by the entry point index.d.ts
-// src/plugins/data/server/index.ts:270:1 - (ae-forgotten-export) The symbol "calcAutoIntervalLessThan" needs to be exported by the entry point index.d.ts
+// src/plugins/data/server/index.ts:244:20 - (ae-forgotten-export) The symbol "getRequestInspectorStats" needs to be exported by the entry point index.d.ts
+// src/plugins/data/server/index.ts:244:20 - (ae-forgotten-export) The symbol "getResponseInspectorStats" needs to be exported by the entry point index.d.ts
+// src/plugins/data/server/index.ts:244:20 - (ae-forgotten-export) The symbol "tabifyAggResponse" needs to be exported by the entry point index.d.ts
+// src/plugins/data/server/index.ts:244:20 - (ae-forgotten-export) The symbol "tabifyGetColumns" needs to be exported by the entry point index.d.ts
+// src/plugins/data/server/index.ts:246:1 - (ae-forgotten-export) The symbol "CidrMask" needs to be exported by the entry point index.d.ts
+// src/plugins/data/server/index.ts:247:1 - (ae-forgotten-export) The symbol "dateHistogramInterval" needs to be exported by the entry point index.d.ts
+// src/plugins/data/server/index.ts:256:1 - (ae-forgotten-export) The symbol "InvalidEsCalendarIntervalError" needs to be exported by the entry point index.d.ts
+// src/plugins/data/server/index.ts:257:1 - (ae-forgotten-export) The symbol "InvalidEsIntervalFormatError" needs to be exported by the entry point index.d.ts
+// src/plugins/data/server/index.ts:258:1 - (ae-forgotten-export) The symbol "Ipv4Address" needs to be exported by the entry point index.d.ts
+// src/plugins/data/server/index.ts:262:1 - (ae-forgotten-export) The symbol "isValidEsInterval" needs to be exported by the entry point index.d.ts
+// src/plugins/data/server/index.ts:263:1 - (ae-forgotten-export) The symbol "isValidInterval" needs to be exported by the entry point index.d.ts
+// src/plugins/data/server/index.ts:267:1 - (ae-forgotten-export) The symbol "propFilter" needs to be exported by the entry point index.d.ts
+// src/plugins/data/server/index.ts:270:1 - (ae-forgotten-export) The symbol "toAbsoluteDates" needs to be exported by the entry point index.d.ts
+// src/plugins/data/server/index.ts:271:1 - (ae-forgotten-export) The symbol "calcAutoIntervalLessThan" needs to be exported by the entry point index.d.ts
// src/plugins/data/server/plugin.ts:79:74 - (ae-forgotten-export) The symbol "DataEnhancements" needs to be exported by the entry point index.d.ts
// src/plugins/data/server/search/types.ts:114:5 - (ae-forgotten-export) The symbol "ISearchStartSearchSource" needs to be exported by the entry point index.d.ts
diff --git a/src/plugins/discover/public/index.ts b/src/plugins/discover/public/index.ts
index de76c65ccdc9..fbe853ec6deb 100644
--- a/src/plugins/discover/public/index.ts
+++ b/src/plugins/discover/public/index.ts
@@ -16,4 +16,5 @@ export function plugin(initializerContext: PluginInitializerContext) {
export { SavedSearch, SavedSearchLoader, createSavedSearchesLoader } from './saved_searches';
export { ISearchEmbeddable, SEARCH_EMBEDDABLE_TYPE, SearchInput } from './application/embeddable';
+export { loadSharingDataHelpers } from './shared';
export { DISCOVER_APP_URL_GENERATOR, DiscoverUrlGeneratorState } from './url_generator';
diff --git a/src/plugins/discover/public/shared/index.ts b/src/plugins/discover/public/shared/index.ts
new file mode 100644
index 000000000000..b1e4d9d87000
--- /dev/null
+++ b/src/plugins/discover/public/shared/index.ts
@@ -0,0 +1,14 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+/*
+ * Allows the getSharingData function to be lazy loadable
+ */
+export async function loadSharingDataHelpers() {
+ return await import('../application/helpers/get_sharing_data');
+}