Skip to content

Conversation

@elastic-jasper
Copy link
Contributor

Fix filters for complex painless scripted fields

Backports PR #9171

Commit 1:
Fix filters for complex painless scripted fields

Painless scripted fields that consisted of more than a single expression
would break when the user attempted to filter on them in Discover or
Visualize because of the naive way we were building them. We now wrap
the user's script in a lambda so that it can be as complex at they need
it to be. The only special exception is that the user cannot define
named functions since those cannot go inside a Painless lambda.

Fixes #9024
Related elastic/elasticsearch#21635

Commit 2:
DRY it up

Commit 3:
Phrase tests

Commit 4:
Only include necessary comparators and add tests

Backports PR #9171

**Commit 1:**
Fix filters for complex painless scripted fields

Painless scripted fields that consisted of more than a single expression
would break when the user attempted to filter on them in Discover or
Visualize because of the naive way we were building them. We now wrap
the user's script in a lambda so that it can be as complex at they need
it to be. The only special exception is that the user cannot define
named functions since those cannot go inside a Painless lambda.

Fixes #9024
Related elastic/elasticsearch#21635

* Original sha: b2a86bb
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-11-21T23:18:20Z

**Commit 2:**
DRY it up

* Original sha: 927de50
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-11-22T16:21:21Z

**Commit 3:**
Phrase tests

* Original sha: 79e69bd
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-11-22T16:48:12Z

**Commit 4:**
Only include necessary comparators and add tests

* Original sha: 5b9137b
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-11-22T17:38:59Z
@elastic-jasper elastic-jasper added the backport This PR is a backport of another PR label Nov 29, 2016
@epixa epixa merged commit 313794b into 5.1 Nov 29, 2016
@epixa epixa deleted the jasper/backport/9171/5.1 branch November 29, 2016 16:00
airow pushed a commit to airow/kibana that referenced this pull request Feb 16, 2017
Backports PR elastic#9171

**Commit 1:**
Fix filters for complex painless scripted fields

Painless scripted fields that consisted of more than a single expression
would break when the user attempted to filter on them in Discover or
Visualize because of the naive way we were building them. We now wrap
the user's script in a lambda so that it can be as complex at they need
it to be. The only special exception is that the user cannot define
named functions since those cannot go inside a Painless lambda.

Fixes elastic#9024
Related elastic/elasticsearch#21635

* Original sha: b2a86bb
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-11-21T23:18:20Z

**Commit 2:**
DRY it up

* Original sha: 927de50
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-11-22T16:21:21Z

**Commit 3:**
Phrase tests

* Original sha: 79e69bd
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-11-22T16:48:12Z

**Commit 4:**
Only include necessary comparators and add tests

* Original sha: 5b9137b
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-11-22T17:38:59Z

Former-commit-id: 313794b
mgadewoll added a commit that referenced this pull request Dec 8, 2025
## Dependency updates

- `@elastic/eui`: `v109.2.0` ⏩ `v110.0.0`

---

## Changes

- Updates usages of the `message` prop on `EuiInMemoryTable` to
`noItemsMessage`
- Updates usages of `EuiSearchBar`'s `onChange` prop to check for the
`query` argument, as it may be `null` now
- Removes obsolete `color` props on implementations of `EuiPageTemplate`
and `EuiPageTemplate.Header` (`color` prop wasn't applied before either)

## Package updates

### `@elastic/eui` v110.0.0

- Updated `EuiSuperDatePicker` to expose plain text `utcOffset` and
`timeZoneName` in `timeZoneDisplayProps.customRender` render function
([#9245](elastic/eui#9245))
- Updated `EuiHeaderLogo` to add a hover style
([#9240](elastic/eui#9240))
- Made `EuiQuickSelectPanel` available for importing from the
`@elastic/eui` package
([#9239](elastic/eui#9239))
- Updated `EuiAvatar` to support Emoji Sequence ("advanced") in the
`initials` prop ([#9227](elastic/eui#9227))
- Added `color` prop on `EuiPageHeader` to support `transparent`
(default) and `plain` backgrounds.
([#9220](elastic/eui#9220))
- Added `color` prop on `EuiPage` to support `transparent` (default) and
`plain` backgrounds. ([#9220](elastic/eui#9220))
- Updated `EuiPageTemplate` to ensure `panelled=true` renders a
`EuiPageHeader` with a plain background by default
([#9220](elastic/eui#9220))
- Removed the default background style on `EuiPageTemplate`'s outer
wrapper ([#9220](elastic/eui#9220))

**Bug fixes**

- Fixed icon size in `EuiSuperDatePicker`'s time window buttons when
`compressed={true}` ([#9245](elastic/eui#9245))
- Fixed `EuiIcon` visibility issue with `logoElastic` when `color` is
set to `text` or `ghost` in light mode
([#9247](elastic/eui#9247))
- Fixed `EuiInMemoryTable` support for controlled search for plain text
(when `searchFormat="text"`) by properly handling `search.query` and
`search.defaulQuery` ([#9142](elastic/eui#9142))

**Breaking changes**

- Removed deprecated `message` prop from `EuiInMemoryTable`, use
`noItemsMessage` instead
([#9234](elastic/eui#9234))

**Accessibility**

- Improved the accessibility of input fields in the popover of
`EuiSuperDatePicker` by properly labeling them
([#9239](elastic/eui#9239))
- Improved the accessibility of `EuiSelectable` by removing empty
`aria-activedescendant` attribute when no option is active to ensure the
search input is perceivable by screen readers
([#9223](elastic/eui#9223))

---------

Co-authored-by: Weronika Olejniczak <weronika.olejniczak@elastic.co>
Co-authored-by: Jorge Oliveira <jorge.oliveira@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
JordanSh pushed a commit to JordanSh/kibana that referenced this pull request Dec 9, 2025
## Dependency updates

- `@elastic/eui`: `v109.2.0` ⏩ `v110.0.0`

---

## Changes

- Updates usages of the `message` prop on `EuiInMemoryTable` to
`noItemsMessage`
- Updates usages of `EuiSearchBar`'s `onChange` prop to check for the
`query` argument, as it may be `null` now
- Removes obsolete `color` props on implementations of `EuiPageTemplate`
and `EuiPageTemplate.Header` (`color` prop wasn't applied before either)

## Package updates

### `@elastic/eui` v110.0.0

- Updated `EuiSuperDatePicker` to expose plain text `utcOffset` and
`timeZoneName` in `timeZoneDisplayProps.customRender` render function
([elastic#9245](elastic/eui#9245))
- Updated `EuiHeaderLogo` to add a hover style
([elastic#9240](elastic/eui#9240))
- Made `EuiQuickSelectPanel` available for importing from the
`@elastic/eui` package
([elastic#9239](elastic/eui#9239))
- Updated `EuiAvatar` to support Emoji Sequence ("advanced") in the
`initials` prop ([elastic#9227](elastic/eui#9227))
- Added `color` prop on `EuiPageHeader` to support `transparent`
(default) and `plain` backgrounds.
([elastic#9220](elastic/eui#9220))
- Added `color` prop on `EuiPage` to support `transparent` (default) and
`plain` backgrounds. ([elastic#9220](elastic/eui#9220))
- Updated `EuiPageTemplate` to ensure `panelled=true` renders a
`EuiPageHeader` with a plain background by default
([elastic#9220](elastic/eui#9220))
- Removed the default background style on `EuiPageTemplate`'s outer
wrapper ([elastic#9220](elastic/eui#9220))

**Bug fixes**

- Fixed icon size in `EuiSuperDatePicker`'s time window buttons when
`compressed={true}` ([elastic#9245](elastic/eui#9245))
- Fixed `EuiIcon` visibility issue with `logoElastic` when `color` is
set to `text` or `ghost` in light mode
([elastic#9247](elastic/eui#9247))
- Fixed `EuiInMemoryTable` support for controlled search for plain text
(when `searchFormat="text"`) by properly handling `search.query` and
`search.defaulQuery` ([elastic#9142](elastic/eui#9142))

**Breaking changes**

- Removed deprecated `message` prop from `EuiInMemoryTable`, use
`noItemsMessage` instead
([elastic#9234](elastic/eui#9234))

**Accessibility**

- Improved the accessibility of input fields in the popover of
`EuiSuperDatePicker` by properly labeling them
([elastic#9239](elastic/eui#9239))
- Improved the accessibility of `EuiSelectable` by removing empty
`aria-activedescendant` attribute when no option is active to ensure the
search input is perceivable by screen readers
([elastic#9223](elastic/eui#9223))

---------

Co-authored-by: Weronika Olejniczak <weronika.olejniczak@elastic.co>
Co-authored-by: Jorge Oliveira <jorge.oliveira@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants