Skip to content

[5.x] Fix filters for complex painless scripted fields#9244

Merged
epixa merged 1 commit into5.xfrom
jasper/backport/9171/5.x
Nov 29, 2016
Merged

[5.x] Fix filters for complex painless scripted fields#9244
epixa merged 1 commit into5.xfrom
jasper/backport/9171/5.x

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 e08041a into 5.x Nov 29, 2016
@epixa epixa deleted the jasper/backport/9171/5.x branch November 29, 2016 16:00
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.

2 participants