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

Make Indices discoverable in Kibana Global Search #175473

Conversation

Samiul-TheSoccerFan
Copy link
Contributor

@Samiul-TheSoccerFan Samiul-TheSoccerFan commented Jan 24, 2024

Summary

Added a search provider to return only visible indices and land in the overview page once clicked or selected.

No indices available

Screenshot 2024-01-24 at 2 48 58 PM

Matched index shows up

Screenshot 2024-01-24 at 2 42 13 PM

Shows all matched index

Screenshot 2024-01-24 at 2 50 09 PM

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@Samiul-TheSoccerFan Samiul-TheSoccerFan requested a review from a team as a code owner January 24, 2024 19:54
@Samiul-TheSoccerFan Samiul-TheSoccerFan requested a review from a team January 24, 2024 19:54
@Samiul-TheSoccerFan Samiul-TheSoccerFan self-assigned this Jan 24, 2024
@Samiul-TheSoccerFan Samiul-TheSoccerFan added v8.13.0 release_note:skip Skip the PR/issue when compiling release notes Team:EnterpriseSearch labels Jan 24, 2024
@Samiul-TheSoccerFan Samiul-TheSoccerFan force-pushed the search-index-in-kibana-search branch from 2e6047f to e3e5894 Compare January 24, 2024 20:10
@Samiul-TheSoccerFan
Copy link
Contributor Author

@elasticmachine merge upstream

@Samiul-TheSoccerFan Samiul-TheSoccerFan added the Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) label Jan 26, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

Copy link
Contributor

@vadimkibana vadimkibana left a comment

Choose a reason for hiding this comment

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

Passing ES client through Global Search context LGTM.

Copy link
Member

@sphilipse sphilipse left a comment

Choose a reason for hiding this comment

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

I have one general concern with this PR and that is the potential poor search performance/cluster degradation on clusters with many indices. Have we tried to see what the performance is like in cases with a very large number of indices?

@Samiul-TheSoccerFan
Copy link
Contributor Author

Samiul-TheSoccerFan commented Jan 26, 2024

I have one general concern with this PR and that is the potential poor search performance/cluster degradation on clusters with many indices. Have we tried to see what the performance is like in cases with a very large number of indices?

I have not tested this code against a large number of indices. Is there a way to automatically generated a large number of indices and/or to test against any benchmark system?
cc: @sphilipse

@sphilipse
Copy link
Member

I have one general concern with this PR and that is the potential poor search performance/cluster degradation on clusters with many indices. Have we tried to see what the performance is like in cases with a very large number of indices?

I have not tested this code against a large number of indices. Is there a way to automatically generated a large number of indices and/or to test against any benchmark system? cc: @sphilipse

Not that I know of, but setting up a script to do this should be doable.

@JoseLuisGJ JoseLuisGJ mentioned this pull request Feb 1, 2024
4 tasks
@Samiul-TheSoccerFan Samiul-TheSoccerFan force-pushed the search-index-in-kibana-search branch from c2ae589 to 6c9e46a Compare February 11, 2024 17:15
* A ES client of type IScopedClusterClient is passed to the `find` call.
* When performing calls to ES, the interested provider can utilize this parameter to identify the specific cluster.
*/
client?: IScopedClusterClient;
Copy link
Member

Choose a reason for hiding this comment

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

nitpicking here, but I think it's neater to pass the concrete Elasticsearch Client with permissions (so the result of client.asCurrentUser) instead of the cluster client which still needs to choose between asCurrentUser and asInternalUser, if possible?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

get_index_data expects a ClusterClient in here and that is why I kept it as clusterClient. Should I write a different method which expects only currentUser?

Copy link
Member

Choose a reason for hiding this comment

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

We should probably pass that function an ElasticsearchClient in all of its usages, but maybe that's too much effort for this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fetch_indices and indices_search_results_providers* both is using this function and probably their related test files. So not much, however, then we should update getSearchIndexData function and its usage too.

Is it okay if I create a separate small PR to handle this update for both functions?

Copy link
Member

Choose a reason for hiding this comment

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

Sure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sphilipse : Can I get an approval if everything looks good?

@Samiul-TheSoccerFan
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
globalSearchBar 27.4KB 27.4KB +27.0B
Unknown metric groups

API count

id before after diff
globalSearch 68 72 +4

History

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

cc @Samiul-TheSoccerFan

@Samiul-TheSoccerFan Samiul-TheSoccerFan merged commit 459dff1 into elastic:main Feb 12, 2024
17 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Feb 12, 2024
@Samiul-TheSoccerFan Samiul-TheSoccerFan deleted the search-index-in-kibana-search branch February 12, 2024 15:25
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
## Summary
Added a search provider to return only visible indices and land in the
overview page once clicked or selected.

### No indices available
<img width="1046" alt="Screenshot 2024-01-24 at 2 48 58 PM"
src="https://github.com/elastic/kibana/assets/150824886/82d5a997-2d0b-42e0-8818-2f4b83170230">

### Matched index shows up
<img width="920" alt="Screenshot 2024-01-24 at 2 42 13 PM"
src="https://github.com/elastic/kibana/assets/150824886/59bd676c-f5c3-4b10-a1ae-cd8b4008c81e">

### Shows all matched index
<img width="1048" alt="Screenshot 2024-01-24 at 2 50 09 PM"
src="https://github.com/elastic/kibana/assets/150824886/30877185-ac9c-4fe2-b859-d597dd3941b1">


### Checklist

Delete any items that are not applicable to this PR.

- [X] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
fkanout pushed a commit to fkanout/kibana that referenced this pull request Mar 4, 2024
## Summary
Added a search provider to return only visible indices and land in the
overview page once clicked or selected.

### No indices available
<img width="1046" alt="Screenshot 2024-01-24 at 2 48 58 PM"
src="https://github.com/elastic/kibana/assets/150824886/82d5a997-2d0b-42e0-8818-2f4b83170230">

### Matched index shows up
<img width="920" alt="Screenshot 2024-01-24 at 2 42 13 PM"
src="https://github.com/elastic/kibana/assets/150824886/59bd676c-f5c3-4b10-a1ae-cd8b4008c81e">

### Shows all matched index
<img width="1048" alt="Screenshot 2024-01-24 at 2 50 09 PM"
src="https://github.com/elastic/kibana/assets/150824886/30877185-ac9c-4fe2-b859-d597dd3941b1">


### Checklist

Delete any items that are not applicable to this PR.

- [X] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:EnterpriseSearch Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants