-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GS] add savedObjects result provider #68619
[GS] add savedObjects result provider #68619
Conversation
Are we blocked on anything for this one? |
@ryankeairns The PR should be ready soon. In the meantime, a status regarding the current 'searchable' saved objects. For the record, the rules to be searchable by the GS API are the same that from the savedObject management section:
Currently, these types match these criteria and are findable by the GS API: [
'index-pattern',
'query',
'search',
'visualization',
'canvas-workpad',
'map',
'dashboard',
'lens'
]
For the record, a quick list of all our registered SO types: [ 'config',
'task',
'telemetry',
'ui-metric',
'application_usage_totals',
'application_usage_transactional',
'timelion-sheet',
'url',
'index-pattern',
'query',
'kql-telemetry',
'search',
'sample-data-telemetry',
'upgrade-assistant-reindex-operation',
'upgrade-assistant-telemetry',
'file-upload-telemetry',
'visualization',
'tsvb-validation-telemetry',
'canvas-element',
'canvas-workpad',
'maps-telemetry',
'map',
'graph-workspace',
'dashboard',
'lens',
'lens-ui-telemetry',
'space',
'action',
'action_task_params',
'cases',
'cases-comments',
'cases-configure',
'cases-user-actions',
'alert',
'infrastructure-ui-source',
'metrics-explorer-view',
'inventory-view',
'uptime-dynamic-settings',
'ml-telemetry',
'apm-indices',
'apm-telemetry'
] |
Pinging @elastic/kibana-platform (Team:Platform) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some optional nits, LGTM overall
x-pack/plugins/global_search_providers/server/providers/saved_objects/provider.ts
Outdated
Show resolved
Hide resolved
import { GlobalSearchResultProvider } from '../../../../global_search/server'; | ||
import { mapToResults } from './map_object_to_result'; | ||
|
||
export const createSavedObjectsResultProvider = (): GlobalSearchResultProvider => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we need the factory pattern here?
x-pack/plugins/global_search_providers/server/providers/saved_objects/provider.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/global_search_providers/server/providers/saved_objects/map_object_to_result.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/global_search_providers/server/providers/saved_objects/map_object_to_result.ts
Outdated
Show resolved
Hide resolved
.pipe( | ||
map((batch) => batch.results), | ||
// remove test types | ||
map((results) => results.filter((r) => !r.type.startsWith('test_'))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
map + reduce
combination can be substituted by flatMap
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flatMap
would emit an individual event for each result. Could be replace with flatMap
+ toArray
, but map
+ reduce
is probably more explicit.
x-pack/test/plugin_functional/test_suites/global_search/global_search_providers.ts
Show resolved
Hide resolved
x-pack/test/plugin_functional/test_suites/global_search/global_search_providers.ts
Show resolved
Hide resolved
💚 Build SucceededBuild metrics
History
To update your PR or re-run it, just comment with: |
* create server-side skeleton * add base implementation & tests * add unit test for provider * remove useless contracts * add preference search option * implement score from find results * fix types * add FTR test * fix test plugin types * address ome review comments * add multi results test * use `getVisibleTypes`
* create server-side skeleton * add base implementation & tests * add unit test for provider * remove useless contracts * add preference search option * implement score from find results * fix types * add FTR test * fix test plugin types * address ome review comments * add multi results test * use `getVisibleTypes`
* master: [APM] Fix flaky e2e’s (elastic#70790) [Discover] Migrate server side saved object from data to discover plugin (elastic#70342) [APM] Update docs on running API tests (elastic#70765) test: 💍 delete a flaky test (elastic#70785) [Security Solution] Refactor GlobalTime to useGlobalTime hook and cle… (elastic#69345) Remove IE11 mention from PR template [skip ci] (elastic#70486) [GS] add savedObjects result provider (elastic#68619) remove snapshot from disabled test suite. (elastic#70769)
@pgayvallet apologies for the delayed response, I've been out of the office for the past two weeks. The list for V1 looks great and there are no other objects that I, personally, expected to appear from the second list. That said, there are some interesting items in that second list (e.g. cases) that I'm sure other teams would like to have included. As part of demoing and promoting this new feature, @alexfrancoeur and I can communicate to other teams how they can get their content registered. Out of curiosity, is there a way to test the search API and see what sort of results are returned? Thank you for all of your hard work, we are beyond excited to get this into Kibana and start trying it out! |
Thanks for the tag @ryankeairns. I have some comments and a few follow up questions listed below. Generally, this list looks good to me but I see a few saved objects that we'll probably want to return eventually. I would think
One last question, are the saved objects returned filtered through feature control and sub-feature control settings for the role that is searching? |
+1 to creating issues for those we know we want to include sooner rather than later. |
* actions/feature: improved copy [APM] Fix flaky e2e’s (elastic#70790) [Discover] Migrate server side saved object from data to discover plugin (elastic#70342) [APM] Update docs on running API tests (elastic#70765) test: 💍 delete a flaky test (elastic#70785) [Security Solution] Refactor GlobalTime to useGlobalTime hook and cle… (elastic#69345) Remove IE11 mention from PR template [skip ci] (elastic#70486) [GS] add savedObjects result provider (elastic#68619) remove snapshot from disabled test suite. (elastic#70769)
Unfortunately as it's not 'plugged' anywhere yet, the only solution I see to test the returned results would be to directly query the endpoint, with curl, postman or any other tool.
not that the application results would not be listed, as this would only return the server-side results. But all searchable SO results would be returned. |
Summary
Fix #65222
Checklist