-
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
[Discover] Compile error when filtering on scripted fields #8404
Comments
below is an example of an ES search request that triggers this error. It appears we get an error when using the script as part of a filter.
Response:
|
Confirmed with ES that the issue is on our side (See elastic/elasticsearch#20885). It appears like the request should send instead of
|
Users can theoretically write groovy and other language scripts if they've manually enabled them in ES, so we should probably check those as well. |
I think I found the culprit and have a fix, at least for painless & expression. I'm not sure about the other script types. Kibana will show additional options in the language dropdown depending on ES settings? How can I adjust those settings to verify if it works? |
You can enable groovy in your grunt esvm config by adding the following code to your grunt esvm (esvm.js) dev config block:
|
Good call on checking Groovy - indeed it is not happy with params.value. Checking with @clintongormley to see if this is expected. |
Need to use params.value instead of value. Fixes elastic#8404 Add params prefix in another spot for painless scripted fields Fix date histogram with scripted fields Remove format: epoch_millis so the script compiles. I am not 100% confident of the side affect from this (it’s used for non-scripted fields, but I’m not sure where I would put it for scripted fields, or if it’s needed). At any rate, it appears that formatting settings for scripted fields is still being honored, even after removing it from params.
--------- **Commit 1:** Fix our request to ES for filtering on scripted fields Need to use params.value instead of value. Fixes #8404 Add params prefix in another spot for painless scripted fields Fix date histogram with scripted fields Remove format: epoch_millis so the script compiles. I am not 100% confident of the side affect from this (it’s used for non-scripted fields, but I’m not sure where I would put it for scripted fields, or if it’s needed). At any rate, it appears that formatting settings for scripted fields is still being honored, even after removing it from params. * Original sha: 7cdb74d * Authored by Stacey Gammon <[email protected]> on 2016-10-12T14:54:23Z
--------- **Commit 1:** Fix our request to ES for filtering on scripted fields Need to use params.value instead of value. Fixes #8404 Add params prefix in another spot for painless scripted fields Fix date histogram with scripted fields Remove format: epoch_millis so the script compiles. I am not 100% confident of the side affect from this (it’s used for non-scripted fields, but I’m not sure where I would put it for scripted fields, or if it’s needed). At any rate, it appears that formatting settings for scripted fields is still being honored, even after removing it from params. * Original sha: 7cdb74d * Authored by Stacey Gammon <[email protected]> on 2016-10-12T14:54:23Z
--------- **Commit 1:** Fix our request to ES for filtering on scripted fields Need to use params.value instead of value. Fixes elastic#8404 Add params prefix in another spot for painless scripted fields Fix date histogram with scripted fields Remove format: epoch_millis so the script compiles. I am not 100% confident of the side affect from this (it’s used for non-scripted fields, but I’m not sure where I would put it for scripted fields, or if it’s needed). At any rate, it appears that formatting settings for scripted fields is still being honored, even after removing it from params. * Original sha: 24622fad83d0388a38d9557e4a1ff7b80ec27083 [formerly 7cdb74d] * Authored by Stacey Gammon <[email protected]> on 2016-10-12T14:54:23Z Former-commit-id: 4b54dc6
To repro:
After following the above steps and attempt to filter by a script value, I run into a Discover: compile error with the following error message:
The text was updated successfully, but these errors were encountered: