99cd66f72d
* move context to server part. couple with RequestHandlerContext Context implementation will be simplified in follow-up. * adopt core code * adopt bfetch code * adopt data code * adopt search examples * adopt vis_type_timelion * adopt vis_type_timeseries * adopt plugin functional tests * adopt actions * adopt alerting plugin * adopt APM plugin * adopt beats_management * adopt case plugin * adopt cross_cluster_replication * adopt data_enhanced * adopt event_log * adopt global_search * adopt index_management * adopt infra * adopt licensing * adopt lists * adopt logstash * adopt reporting * adopt observability * adopt monitoring * adopt rollup * adopt so tagging * adopt security * adopt security_solutions * adopt watcher * adopt uptime * adopt spaces * adopt snapshot_restore * adopt features changes * mute error when null used to extend context * update docs * small cleanup * add type safety for return type * refactor registerRouteHandlerContext type * update docs * update license header * update docs * fix type error. fetch body does not accept array of strings * fix telemetry test * remove unnecessary ts-ignore * address comments * update docs # Conflicts: # docs/development/plugins/data/server/kibana-plugin-plugins-data-server.plugin.start.md # src/plugins/data/server/server.api.md # x-pack/plugins/monitoring/server/plugin.ts |
||
---|---|---|
.. | ||
common | ||
public | ||
server | ||
jest.config.js | ||
kibana.json | ||
README.md | ||
tsconfig.json |
Kibana GlobalSearch plugin
The GlobalSearch plugin provides an easy way to search for various objects, such as applications or dashboards from the Kibana instance, from both server and client-side plugins
Consuming the globalSearch API
startDeps.globalSearch.find('some term').subscribe({
next: ({ results }) => {
addNewResultsToList(results);
},
error: () => {},
complete: () => {
showAsyncSearchIndicator(false);
}
});
Registering custom result providers
The GlobalSearch API allows to extend provided results by registering your own provider.
setupDeps.globalSearch.registerResultProvider({
id: 'my_provider',
find: (term, options, context) => {
const resultPromise = myService.search(term, context.core.savedObjects.client);
return from(resultPromise).pipe(takeUntil(options.aborted$);
},
});
Known limitations
Client-side registered providers
Results from providers registered from the client-side registerResultProvider
API will
not be available when performing a search from the server-side. For this reason, prefer
registering providers using the server-side API when possible.
Refer to the RFC for more details
Search completion cause
There is currently no way to identify globalSearch.find
observable completion cause:
searches completing because all providers returned all their results and searches
completing because the consumer aborted the search using the aborted$
option or because
the internal timout period has been reaches will both complete the same way.