Skip to content
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 the provider field to GlobalSearchResult #68878

Closed

Conversation

pgayvallet
Copy link
Contributor

Summary

Related to #68619

Add a provider field to the result type to allow consumers to access this information. Main use case would be for sorting results by provider.

Checklist

@pgayvallet pgayvallet added release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.9.0 v8.0.0 labels Jun 11, 2020
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@pgayvallet pgayvallet marked this pull request as ready for review June 11, 2020 17:49
@pgayvallet pgayvallet requested a review from a team as a code owner June 11, 2020 17:49
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

Copy link
Contributor

@joshdover joshdover left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does make the the Global Search API a slightly leaky abstraction...consumers now will need to have up-front knowledge of the registered providers in order to display them in the preferred order.

This is probably the most practical option though. The only other option I see is having providers register an order parameter that is used to rank results, similar to how applications specify their order in the Chrome nav. However, I think that just makes consuming this API less flexible.

@pgayvallet
Copy link
Contributor Author

This does make the the Global Search API a slightly leaky abstraction...consumers now will need to have up-front knowledge of the registered providers in order to display them in the preferred order.

I agree, we are leaking something that maybe should remain an implementation detail of the API.

Also, specifically for the searchbar needs for v1, it should be possible to sort by type, or at least to put the application type results on top, and the other kind sorted by score afterward.

I was more doing this as preliminary work for the next step, when we'll have multiple providers returning the same kind of results (I'm thinking SO results from other spaces for instance)

Maybe the meta field could be used instead, by storing the associated space for example, and this PR is unneeded.

I'm going to close it for now, as it should not be needed in the short term. We'll see if we'll need to reopen it later.

@pgayvallet pgayvallet closed this Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants