mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Add a note on multi-statement scripted field limitation (#9122)
Backports PR #9090
**Commit 1:**
Add a note on multi-statement scripted field limitation
Multi-statement scripts are currently incompatible with the way we
create filters on scripted fields. We're investigating the possibility
of enhancing elasticsearch to fix this issue, but we may have to
fallback on showing users a warning if we can't reach an agreement in
the near term.
See https://github.com/elastic/kibana/issues/9024
Related https://github.com/elastic/elasticsearch/issues/21479
* Original sha: b4aaed8282
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-11-15T22:47:26Z
This commit is contained in:
parent
f8854cd9c3
commit
28c433fe2c
1 changed files with 13 additions and 0 deletions
|
@ -146,6 +146,19 @@
|
|||
Painless is powerful but easy to use. It provides access to many <a target="_window" ng-href="{{editor.docLinks.painlessApi}}">native Java APIs <i class="fa-link fa"></i></a>. Read up on its <a target="_window" ng-href="{{editor.docLinks.painlessSyntax}}">syntax <i class="fa-link fa"></i></a> and you'll be up to speed in no time!
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Kibana currently imposes one special limitation on the scripts you write. Your scripts must consist of a single expression. Multi-statement scripts with an explicit return statement will not work.
|
||||
In other words, the above example is a valid script, but something like the following is not.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Invalid</strong><br/>
|
||||
<code>
|
||||
def myField = doc['some_field'].value;<br/>
|
||||
return myField;
|
||||
</code>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Coming from an older version of Kibana? The <a target="_window" ng-href="{{editor.docLinks.luceneExpressions}}">Lucene Expressions <i class="fa-link fa"></i></a> you know and love are still available. Lucene expressions are a lot like JavaScript, but limited to basic arithmetic, bitwise and comparison operations.
|
||||
</p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue