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

Adds match_only_text to ES_FIELD_TYPES #133690

Merged
merged 1 commit into from
Jun 7, 2022

Conversation

spong
Copy link
Member

@spong spong commented Jun 6, 2022

Summary

A new Security Solution feature (#131475) was added in 8.3 that displays a field name and icon token using the reusable FieldIcon component. In testing an issue was reported (#133291) that the wrong icon token was being displayed.

I had previously updated FieldIcon to support match_only_text however this new issue was with the float type not displaying correctly. After some searching I found the castEsToKbnFieldTypeName utility which solved the issue with float fields not displaying, but then match_only_text field types would not show since it is missing from ES_FIELD_TYPES and so would resolve as unknown.

This PR adds the match_only_text ES type to ES_FIELD_TYPES to resolve this missing icon token issue so that castEsToKbnFieldTypeName can be used in conjunction with the resuable FieldIcon component.

I imagine this is fine as it's a sibling type to text, but am curious here since sortable: true, is set for the KbnFieldType even though it includes ES_FIELD_TYPES.TEXT (which is not sortable) as well?

@spong spong added bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Detection Rule Management Security Detection Rule Management Team v8.3.0 v8.4.0 labels Jun 6, 2022
@spong spong requested a review from a team as a code owner June 6, 2022 22:49
@spong spong self-assigned this Jun 6, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
dataViewManagement 122.3KB 122.3KB +55.0B
lens 1.2MB 1.2MB +55.0B
ml 3.3MB 3.3MB +55.0B
unifiedSearch 177.4KB 177.5KB +108.0B
total +273.0B

Page load bundle

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

id before after diff
data 424.6KB 424.7KB +54.0B
dataViewFieldEditor 21.7KB 21.8KB +54.0B
dataViews 38.2KB 38.3KB +54.0B
fieldFormats 44.4KB 44.5KB +54.0B
total +216.0B

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

cc @spong

Copy link
Member

@ppisljar ppisljar left a comment

Choose a reason for hiding this comment

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

LGTM, seems match_only_text performs just like text with the exception of not supporting span queries, which we don't support atm as far as i know.

cc @lukasolson

@spong spong added the auto-backport Deprecated - use backport:version if exact versions are needed label Jun 7, 2022
@spong spong merged commit de3410e into elastic:main Jun 7, 2022
kibanamachine pushed a commit that referenced this pull request Jun 7, 2022
## Summary

A new Security Solution feature (#131475) was added in `8.3` that displays a field name and icon token using the reusable `FieldIcon` component. In testing an issue was reported (#133291) that the wrong icon token was being displayed.

I had [previously updated](https://github.com/elastic/kibana/pull/131475/files#diff-d79a8297783f3177da25dd13fe807425d9136a0e235fe170f7c0a61f2448dacaR23) `FieldIcon` to support `match_only_text` however this new issue was with the `float` type not displaying correctly. After some searching I found the `castEsToKbnFieldTypeName` utility which solved the issue with `float` fields not displaying, but then `match_only_text` field types would not show since it is missing from `ES_FIELD_TYPES` and so would resolve as `unknown`.

This PR adds the `match_only_text` [ES type](https://www.elastic.co/guide/en/elasticsearch/reference/current/text.html#match-only-text-field-type) to `ES_FIELD_TYPES` to resolve this missing icon token issue so that `castEsToKbnFieldTypeName` can be used in conjunction with the resuable `FieldIcon` component.

I imagine this is fine as it's a sibling type to `text`, but am curious here since `sortable: true,` is set for the KbnFieldType even though it includes `ES_FIELD_TYPES.TEXT` (which is not sortable) as well?

(cherry picked from commit de3410e)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.3

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jun 7, 2022
## Summary

A new Security Solution feature (#131475) was added in `8.3` that displays a field name and icon token using the reusable `FieldIcon` component. In testing an issue was reported (#133291) that the wrong icon token was being displayed.

I had [previously updated](https://github.com/elastic/kibana/pull/131475/files#diff-d79a8297783f3177da25dd13fe807425d9136a0e235fe170f7c0a61f2448dacaR23) `FieldIcon` to support `match_only_text` however this new issue was with the `float` type not displaying correctly. After some searching I found the `castEsToKbnFieldTypeName` utility which solved the issue with `float` fields not displaying, but then `match_only_text` field types would not show since it is missing from `ES_FIELD_TYPES` and so would resolve as `unknown`.

This PR adds the `match_only_text` [ES type](https://www.elastic.co/guide/en/elasticsearch/reference/current/text.html#match-only-text-field-type) to `ES_FIELD_TYPES` to resolve this missing icon token issue so that `castEsToKbnFieldTypeName` can be used in conjunction with the resuable `FieldIcon` component.

I imagine this is fine as it's a sibling type to `text`, but am curious here since `sortable: true,` is set for the KbnFieldType even though it includes `ES_FIELD_TYPES.TEXT` (which is not sortable) as well?

(cherry picked from commit de3410e)

Co-authored-by: Garrett Spong <[email protected]>
@spong spong deleted the adds-match-only-text-es-field-type branch June 7, 2022 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team:Detection Rule Management Security Detection Rule Management Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.3.0 v8.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants