-
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
Adds match_only_text
to ES_FIELD_TYPES
#133690
Conversation
Pinging @elastic/security-solution (Team: SecuritySolution) |
💚 Build SucceededMetrics [docs]Async chunks
Page load bundle
To update your PR or re-run it, just comment with: cc @spong |
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.
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
## 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)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
## 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]>
Summary
A new Security Solution feature (#131475) was added in
8.3
that displays a field name and icon token using the reusableFieldIcon
component. In testing an issue was reported (#133291) that the wrong icon token was being displayed.I had previously updated
FieldIcon
to supportmatch_only_text
however this new issue was with thefloat
type not displaying correctly. After some searching I found thecastEsToKbnFieldTypeName
utility which solved the issue withfloat
fields not displaying, but thenmatch_only_text
field types would not show since it is missing fromES_FIELD_TYPES
and so would resolve asunknown
.This PR adds the
match_only_text
ES type toES_FIELD_TYPES
to resolve this missing icon token issue so thatcastEsToKbnFieldTypeName
can be used in conjunction with the resuableFieldIcon
component.I imagine this is fine as it's a sibling type to
text
, but am curious here sincesortable: true,
is set for the KbnFieldType even though it includesES_FIELD_TYPES.TEXT
(which is not sortable) as well?