- Painless Scripting Language: other versions:
- Painless Guide
- Painless Language Specification
- Painless contexts
- Context example data
- Runtime fields context
- Ingest processor context
- Update context
- Update by query context
- Reindex context
- Sort context
- Similarity context
- Weight context
- Score context
- Field context
- Filter context
- Minimum should match context
- Metric aggregation initialization context
- Metric aggregation map context
- Metric aggregation combine context
- Metric aggregation reduce context
- Bucket script aggregation context
- Bucket selector aggregation context
- Analysis Predicate Context
- Watcher condition context
- Watcher transform context
- Painless API Reference
- Shared API
- Aggregation Selector API
- Aggs API
- Aggs Combine API
- Aggs Init API
- Aggs Map API
- Aggs Reduce API
- Analysis API
- Bucket Aggregation API
- Field API
- Filter API
- Ingest API
- Interval API
- Moving Function API
- Number Sort API
- Painless Test API
- Processor Conditional API
- Score API
- Script Heuristic API
- Similarity API
- Similarity Weight API
- String Sort API
- Template API
- Terms Set API
- Update API
- Watcher Condition API
- Watcher Transform API
- Xpack Template API
Operators
editOperators
editAn operator is the most basic action that can be taken to evaluate values in a script. An expression is one-to-many consecutive operations. Precedence is the order in which an operator will be evaluated relative to another operator. Associativity is the direction within an expression in which a specific operator is evaluated. The following table lists all available operators:
Operator |
Category |
Symbol(s) |
Precedence |
Associativity |
() |
0 |
left → right |
||
. () |
1 |
left → right |
||
. |
1 |
left → right |
||
?. |
1 |
left → right |
||
() |
1 |
left → right |
||
[] {} |
1 |
left → right |
||
[] |
1 |
left → right |
||
. |
1 |
left → right |
||
[] |
1 |
left → right |
||
[] |
1 |
left → right |
||
[:] |
1 |
left → right |
||
[] |
1 |
left → right |
||
++ |
1 |
left → right |
||
— |
1 |
left → right |
||
++ |
2 |
right → left |
||
— |
2 |
right → left |
||
+ |
2 |
right → left |
||
- |
2 |
right → left |
||
! |
2 |
right → left |
||
~ |
2 |
right → left |
||
() |
3 |
right → left |
||
new () |
3 |
right → left |
||
new [] |
3 |
right → left |
||
* |
4 |
left → right |
||
/ |
4 |
left → right |
||
% |
4 |
left → right |
||
+ |
5 |
left → right |
||
+ |
5 |
left → right |
||
- |
5 |
left → right |
||
<< |
6 |
left → right |
||
>> |
6 |
left → right |
||
>>> |
6 |
left → right |
||
> |
7 |
left → right |
||
>= |
7 |
left → right |
||
< |
7 |
left → right |
||
<= |
7 |
left → right |
||
instanceof |
8 |
left → right |
||
== |
9 |
left → right |
||
!= |
9 |
left → right |
||
=== |
9 |
left → right |
||
!== |
9 |
left → right |
||
& |
10 |
left → right |
||
^ |
11 |
left → right |
||
^ |
11 |
left → right |
||
| |
12 |
left → right |
||
&& |
13 |
left → right |
||
|| |
14 |
left → right |
||
? : |
15 |
right → left |
||
?: |
16 |
right → left |
||
= |
17 |
right → left |
||
$= |
17 |
right → left |