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

[Logs UI] Replace query bar with data plugin SearchBar #53310

Closed
Zacqary opened this issue Dec 17, 2019 · 13 comments
Closed

[Logs UI] Replace query bar with data plugin SearchBar #53310

Zacqary opened this issue Dec 17, 2019 · 13 comments
Assignees
Labels
Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services

Comments

@Zacqary
Copy link
Contributor

Zacqary commented Dec 17, 2019

When discussing the performance issues tracked in #52930, it was suggested that we replace the Query Bar in the Logs UI entirely with the Saved Search with Filter component.

We should use the Search Bar component from the data plugin: #53123 (comment)

SearchBar: https://github.com/elastic/kibana/blob/master/src/plugins/data/public/ui/search_bar/search_bar.tsx

We can disable all other features of the SearchBar besides Query String Input, giving us the opportunity to easily enable them later.

Syntax for importing the stateful SearchBar:

import { npStart } from 'ui/new_platform';
const { SearchBar } = npStart.plugins.data.ui;
@Zacqary Zacqary added discuss Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services labels Dec 17, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui)

@jasonrhodes
Copy link
Member

This may be available in the new data plugin: #53123 (comment)

The Saved Search with Filter EUI component is here: https://elastic.github.io/eui/#/forms/suggest#saved-queries-and-filters

We also discussed trying to improve the performance of our existing query bar implementation before swapping out the components. We should try that first and then wait until the new platform migration before making these changes in case the components are available in the new data plugin etc.

Performance improvement issue: #52930

@jasonrhodes
Copy link
Member

jasonrhodes commented Jan 6, 2020

We should investigate the Search Bar component from the data plugin to see if that's an easy drop-in replacement. #53123 (comment)

SearchBar: https://github.com/elastic/kibana/blob/master/src/plugins/data/public/ui/search_bar/search_bar.tsx

@jasonrhodes jasonrhodes changed the title [Logs UI] [Discuss] Replace query bar with Saved Search with Filter [Logs UI] [Discuss] Replace query bar with Saved Search with Filter Jan 6, 2020
@Zacqary
Copy link
Contributor Author

Zacqary commented Jan 29, 2020

Consulted with @lizozom on how to work with SearchBar, here's what I found out.

The SearchBar API is about to be simplified significantly by #56160, which also contains the most up-to-date documentation on how to implement it. We'll want to wait until this PR merges to move forward, or base our work off of it.

We probably don't want to import the stateless SearchBar component on its own; we can use a stateful version from npStart like this:

import { npStart } from 'ui/new_platform';
const { SearchBar } = npStart.plugins.data.ui;

We have a couple options with what SearchBar provides:

QueryStringInput

SearchBar implements a smaller component called QueryStringInput, which is also available from the Data plugin. This would be a drop-in replacement for our current Autocomplete box with just about the same features, and more performant. This would at least fill the requirements of #52930

Using Full-Featured SearchBar

We can also just use SearchBar and disable all other features besides the query input, which would allow us to more easily turn on any additional features we wanted later. For example:

The SearchBar is not customizable with buttons in the middle of it, so if we wanted to go all-in with SearchBar we'd need to move the Customize and Highlights buttons someplace else in the UI. This might encourage us to make our toolbar UI more consistent with the rest of Kibana.

@weltenwort
Copy link
Member

Is the full-featured search bar technically tied to the data plugin data fetching or can we still supply our own field list and fetch the data from our own APIs?

@Zacqary
Copy link
Contributor Author

Zacqary commented Jan 30, 2020

@weltenwort
Copy link
Member

I see, the autocompletion was moved into the data plugin. What I meant was that we still need to be able to use our ad-hoc index pattern at

and need to have control over how we send the resulting query to our own API instead of being tied to the Elasticsearch data access that the data plugin provides. After looking at the code I think that it won't be a problem though. 👍

@afgomez
Copy link
Contributor

afgomez commented Jan 31, 2020

The SearchBar is not customizable with buttons in the middle of it, so if we wanted to go all-in with SearchBar we'd need to move the Customize and Highlights buttons someplace else in the UI.

Maybe that's good. The SuperDatePicker is much wider than the one we currently use, making the rest of the components look crammed on narrow screens.

Screenshot 2020-01-31 at 12 35 13

Notice the datepicker is bigger than the searchbar. Not very nice :/

@Zacqary Zacqary changed the title [Logs UI] [Discuss] Replace query bar with Saved Search with Filter [Logs UI] Replace query bar with data plugin SearchBar Feb 3, 2020
@zube zube bot changed the title [Logs UI] Replace query bar with data plugin SearchBar [Logs UI] [Discuss] Replace query bar with Saved Search with Filter Feb 3, 2020
@zube zube bot added the discuss label Feb 3, 2020
@Zacqary Zacqary removed the discuss label Feb 3, 2020
@Zacqary Zacqary changed the title [Logs UI] [Discuss] Replace query bar with Saved Search with Filter [Logs UI] Replace query bar with data plugin SearchBar Feb 3, 2020
@Raulkg
Copy link

Raulkg commented Jun 21, 2020

Any comments on using Fully Featured Searchbar in my custom plugin in kibana version 7.4.2 ?

@weltenwort
Copy link
Member

@Raulkg there should be nothing that keeps you from using the component provided by the data plugin.

@felix-lessoer
Copy link

+1 for getting the Discover Search Bar also in the Logs UI

@afgomez
Copy link
Contributor

afgomez commented Mar 29, 2022

@weltenwort is this still relevant? I see the searchbar imports some components from the data plugin.

@weltenwort
Copy link
Member

weltenwort commented Mar 31, 2022

We're using components provided by the data plugin, but have disabled all features beyond the plain search. IMHO it would make sense to close this until the ongoing Kibana-wide unified search effort has progressed to the actual implementation stage.

@afgomez afgomez closed this as completed Apr 1, 2022
@zube zube bot removed the [zube]: Done label Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services
Projects
None yet
Development

No branches or pull requests

7 participants