mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
[data.search.session] Use locators instead of URL generators (#115681)
* [data.search.session] Use locators instead of URL generators * Add migration * Fix/update tests * Fix types * Fix test setup * Update docs * Fix version :) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
1211149038
commit
eb74b86ca4
29 changed files with 411 additions and 188 deletions
|
@ -13,7 +13,7 @@ tags: ['kibana', 'onboarding', 'dev', 'tutorials', 'search', 'sessions', 'search
|
|||
|
||||
Searching data stored in Elasticsearch can be done in various ways, for example using the Elasticsearch REST API or using an `Elasticsearch Client` for low level access.
|
||||
|
||||
However, the recommended and easist way to search Elasticsearch is by using the low level search service. The service is exposed from the `data` plugin, and by using it, you not only gain access to the data you stored, but also to capabilities, such as Custom Search Strategies, Asynchronous Search, Partial Results, Search Sessions, and more.
|
||||
However, the recommended and easiest way to search Elasticsearch is by using the low level search service. The service is exposed from the `data` plugin, and by using it, you not only gain access to the data you stored, but also to capabilities, such as Custom Search Strategies, Asynchronous Search, Partial Results, Search Sessions, and more.
|
||||
|
||||
Here is a basic example for using the `data.search` service from a custom plugin:
|
||||
|
||||
|
@ -418,11 +418,11 @@ export class MyPlugin implements Plugin {
|
|||
// return the name you want to give the saved Search Session
|
||||
return `MyApp_${Math.random()}`;
|
||||
},
|
||||
getUrlGeneratorData: async () => {
|
||||
getLocatorData: async () => {
|
||||
return {
|
||||
urlGeneratorId: MY_URL_GENERATOR,
|
||||
initialState: getUrlGeneratorState({ ...deps, shouldRestoreSearchSession: false }),
|
||||
restoreState: getUrlGeneratorState({ ...deps, shouldRestoreSearchSession: true }),
|
||||
id: MY_LOCATOR,
|
||||
initialState: getLocatorParams({ ...deps, shouldRestoreSearchSession: false }),
|
||||
restoreState: getLocatorParams({ ...deps, shouldRestoreSearchSession: true }),
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue