﻿---
title: Operators
description: Operators are the fundamental building blocks for data manipulation in Painless scripts. They enable calculations, comparisons, logical operations, and...
url: https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators
products:
  - Elasticsearch
  - Painless
applies_to:
  - Elastic Cloud Serverless: Generally available
  - Elastic Stack: Generally available
---

# Operators
Operators are the fundamental building blocks for data manipulation in Painless scripts. They enable calculations, comparisons, logical operations, and data access across all Elasticsearch scripting [contexts](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-contexts).
An **operator** performs a specific action to evaluate values in a script. An **expression** combines one or more operators to produce a result. **Precedence** determines evaluation order when multiple operators are present, while **associativity** controls evaluation direction for operators with equal precedence.
Painless operators use Java-like syntax with Elasticsearch specific enhancements such as null-safe navigation and specialized data structure access.

## Operator categories

Painless organizes operators into five functional categories based on their purpose.
```mermaid
graph TB
    A["Painless Operators"]

    B["General"]
    C["Numeric"]
    D["Boolean"]
    E["Reference"]
    F["Array"]

    B1["Control expression flow and<br/>value assignment"]
    C1["Mathematical operations and<br/>bit manipulation"]
    D1["Boolean logic and<br/>conditional evaluation"]
    E1["Object interaction and<br/>safe data access"]
    F1["Array manipulation and<br/>element access"]

    B2["Precedence ( )<br/>Function Call ( )<br/>Cast ( )<br/>Conditional ? :<br/>Elvis ?:<br/>Assignment =<br/>Compound Assignment $="]
    C2["Post/Pre Increment ++<br/>Post/Pre Decrement --<br/>Unary +/-<br/>Bitwise Not ~<br/>Multiplication *<br/>Division /<br/>Remainder %<br/>Addition +<br/>Subtraction -<br/>Shift <<, >>, >>><br/>Bitwise And &<br/>Bitwise Xor ^<br/>Bitwise Or |"]
    D2["Boolean Not !<br/>Comparison >, >=, <, <=<br/>Instanceof instanceof<br/>Equality ==, !=<br/>Identity ===, !==<br/>Boolean Xor ^<br/>Boolean And &&<br/>Boolean Or ||"]
    E2["Method Call . ( )<br/>Field Access .<br/>Null Safe ?.<br/>New Instance new ( )<br/>String Concatenation +<br/>List/Map Init [ ], [ : ]<br/>List/Map Access [ ]"]
    F2["Array Init [ ] { }<br/>Array Access [ ]<br/>Array Length .length<br/>New Array new [ ]"]

    A --> B & C & D & E & F
    B --> B1
    C --> C1
    D --> D1
    E --> E1
    F --> F1
    B1 --> B2
    C1 --> C2
    D1 --> D2
    E1 --> E2
    F1 --> F2
    
    classDef rootNode fill:#0B64DD,stroke:#101C3F,stroke-width:2px,color:#fff
    classDef categoryBox fill:#e1f5fe,stroke:#01579b,stroke-width:2px,color:#343741
    classDef descBox fill:#48EFCF,stroke:#343741,stroke-width:2px,color:#343741
    classDef exampleBox fill:#f5f7fa,stroke:#343741,stroke-width:2px,color:#343741

    class A rootNode
    class B,C,D,E,F categoryBox
    class B1,C1,D1,E1,F1 descBox
    class B2,C2,D2,E2,F2 exampleBox
```


### General operators

Control the fundamental flow and structure of expressions in Painless scripts. These operators manage how expressions are evaluated, values are assigned, and conditional logic is run.
- [Precedence](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-general#precedence-operator) `()`: Controls evaluation order by overriding default precedence rules
- [Function call](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-general#function-call-operator) `()`: Executes user-defined functions with arguments
- [Cast](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-general#cast-operator) `()` : Forces explicit type conversion between compatible types
- [Conditional](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-general#conditional-operator) `? :` : Provides inline if-else logic for expressions
- [Elvis](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference#elvis-operator) `?:` : Returns first non-null value for null coalescing
- [Assignment](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-general#assignment-operator) `=` : Stores values in variables or fields
- [Compound assignment](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-general#compound-assignment-operator) `$=` : Combines binary operations with assignment (`+=`, `-=`, and so on)


### Numeric operators

Perform mathematical calculations and bit-level manipulations on numeric values. These operators handle arithmetic, bitwise operations, and value modifications essential for numerical computations.
- [Increment](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#post-increment-operator)/[Decrement](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#post-decrement-operator) (`++`. `--`) : Increases or decreases values by one (pre/post variants)
- [Unary](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#unary-positive-operator) (`+`, `-`) : preserves or negates numeric values
- [Bitwise not](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#bitwise-not-operator) `~` : inverts all bits in integer values
- [Multiplication](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#multiplication-operator)/[Division](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#division-operator)/[Remainder](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#remainder-operator) `*` `/` `%` : Basic arithmetic operations
- [Addition](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#addition-operator)/[Subtraction](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#subtraction-operator) `+` `-` : Basic arithmetic operations
- [Shift](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#left-shift-operator) (`<<`, `>>`, `>>>`) : Shifts bits left or right within integer values
- [Bitwise and](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#bitwise-and-operator) `&` : Performs AND operations on corresponding bits
- [Bitwise xor](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#bitwise-xor-operator) `^` : Performs XOR operations on corresponding bits
- [Bitwise or](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#bitwise-or-operator) `|`: Performs OR operations on corresponding bits


### Boolean operators

Handle logical evaluation, comparisons, and conditional expressions. These operators are fundamental for creating filters, conditional logic, and boolean expressions in scripts
- [Boolean not](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean#boolean-not-operator) `!`:Inverts boolean values (true becomes false)
- [Comparison](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean#greater-than-operator) `>` `>=` `<` `<=` : Compares numeric values for ordering
- [Instanceof](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean#instanceof-operator) `instanceof`: Checks if an object is an instance of a specific type
- [Equality](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean#equality-equals-operator) `==` `!=` : Compares values for equality (calls equals() method)
- [Identity](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean#identity-equals-operator) `===` `!==` : Compares object references for same instance
- [Boolean xor](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean#boolean-xor-operator) `^`: Returns true if exactly one operand is true
- [Boolean and](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean#boolean-and-operator) `&&`: Returns true only if both operands are true
- [Boolean or](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean#boolean-or-operator) `||`: Returns true if at least one operand is true


### Reference operators

Enable interaction with objects, method calls, and data structure manipulation. These operators are essential for working with documents, collections, and complex data types in Elasticsearch contexts.
- [Method call](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference#method-call-operator) `. ()`: Invokes methods on objects with optional arguments
- [Field access](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference#field-access-operator) `.`: Accesses object properties and member fields
- [Null safe](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference#null-safe-operator) `?.`: Safely accesses fields/methods without null pointer exceptions
- [List/Map initialization](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference#list-initialization-operator) `[] [:]`: Creates new List or Map collections with initial values
- [List/Map access](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference#list-access-operator) `[]`: Retrieves or sets elements in collections by key/index
- [New instance](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference#new-instance-operator) `new ()`: Creates new object instances with constructor arguments
- [String concatenation](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference#string-concatenation-operator) `+` : Joins strings and converts other types to strings


### Array operators

Provide specialized functionality for array creation, element access, and array property retrieval. These operators are essential when working with multi-value fields and array data structures.
- [Array initialization](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-array#array-initialization-operator) `[] {}``: Creates arrays with predefined values
- [Array access](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-array#array-access-operator) `[]`: Retrieves or sets array elements by index position
- [Array length](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-array#array-length-operator) `.`: Returns the number of elements in an array
- [New array](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-array#new-array-operator) `new []`: Creates arrays with specified dimensions and sizes


## Complete operator reference


| **Operator**                                                                                                                                              | **Category**                                                                                                                           | **Symbol(s)** | **Precedence** | **Associativity** |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|---------------|----------------|-------------------|
| [Precedence](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-general#precedence-operator)                       | [General](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-general)     | ()            | 0              | left → right      |
| [Method call](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference#method-call-operator)                   | [Reference](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference) | . ()          | 1              | left → right      |
| [Field access](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference#field-access-operator)                 | [Reference](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference) | .             | 1              | left → right      |
| [Null safe](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference#null-safe-operator)                       | [Reference](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference) | ?.            | 1              | left → right      |
| [Function call](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-general#function-call-operator)                 | [General](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-general)     | ()            | 1              | left → right      |
| [Array initialization](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-array#array-initialization-operator)     | [Array](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-array)         | [] {}         | 1              | left → right      |
| [Array access](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-array#array-access-operator)                     | [Array](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-array)         | []            | 1              | left → right      |
| [Array length](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-array#array-length-operator)                     | [Array](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-array)         | .             | 1              | left → right      |
| [List initialization](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference#list-initialization-operator)   | [Reference](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference) | []            | 1              | left → right      |
| [List access](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference#list-access-operator)                   | [Reference](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference) | []            | 1              | left → right      |
| [Map initialization](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference#map-initialization-operator)     | [Reference](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference) | [:]           | 1              | left → right      |
| [Map access](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference#map-access-operator)                     | [Reference](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference) | []            | 1              | left → right      |
| [Post increment](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#post-increment-operator)               | [Numeric](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric)     | ++            | 1              | left → right      |
| [Post decrement](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#post-decrement-operator)               | [Numeric](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric)     | —             | 1              | left → right      |
| [Pre increment](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#pre-increment-operator)                 | [Numeric](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric)     | ++            | 2              | right → left      |
| [Pre decrement](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#pre-decrement-operator)                 | [Numeric](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric)     | —             | 2              | right → left      |
| [Unary positive](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#unary-positive-operator)               | [Numeric](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric)     | +             | 2              | right → left      |
| [Unary negative](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#unary-negative-operator)               | [Numeric](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric)     | -             | 2              | right → left      |
| [Boolean not](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean#boolean-not-operator)                     | [Boolean](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean)     | !             | 2              | right → left      |
| [Bitwise not](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#bitwise-not-operator)                     | [Numeric](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric)     | ~             | 2              | right → left      |
| [Cast](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-general#cast-operator)                                   | [General](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-general)     | ()            | 3              | right → left      |
| [New instance](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference#new-instance-operator)                 | [Reference](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference) | new ()        | 3              | right → left      |
| [New array](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-array#new-array-operator)                           | [Array](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-array)         | new []        | 3              | right → left      |
| [Multiplication](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#multiplication-operator)               | [Numeric](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric)     | *             | 4              | left → right      |
| [Division](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#division-operator)                           | [Numeric](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric)     | /             | 4              | left → right      |
| [Remainder](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#remainder-operator)                         | [Numeric](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric)     | %             | 4              | left → right      |
| [String concatenation](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference#string-concatenation-operator) | [Reference](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference) | +             | 5              | left → right      |
| [Addition](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#addition-operator)                           | [Numeric](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric)     | +             | 5              | left → right      |
| [Subtraction](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#subtraction-operator)                     | [Numeric](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric)     | -             | 5              | left → right      |
| [Left shift](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#left-shift-operator)                       | [Numeric](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric)     | <<            | 6              | left → right      |
| [Right shift](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#right-shift-operator)                     | [Numeric](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric)     | >>            | 6              | left → right      |
| [Unsigned right shift](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#unsigned-right-shift-operator)   | [Numeric](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric)     | >>>           | 6              | left → right      |
| [Greater than](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean#greater-than-operator)                   | [Boolean](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean)     | >             | 7              | left → right      |
| [Greater than Or Equal](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean#greater-than-or-equal-operator) | [Boolean](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean)     | >=            | 7              | left → right      |
| [Less than](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean#less-than-operator)                         | [Boolean](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean)     | <             | 7              | left → right      |
| [Less than Or Equal](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean#less-than-or-equal-operator)       | [Boolean](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean)     | <=            | 7              | left → right      |
| [Instanceof](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean#instanceof-operator)                       | [Boolean](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean)     | instanceof    | 8              | left → right      |
| [Equality equals](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean#equality-equals-operator)             | [Boolean](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean)     | ==            | 9              | left → right      |
| [Equality not equals](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean#equality-not-equals-operator)     | [Boolean](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean)     | !=            | 9              | left → right      |
| [Identity equals](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean#identity-equals-operator)             | [Boolean](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean)     | ===           | 9              | left → right      |
| [Identity not equals](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean#identity-not-equals-operator)     | [Boolean](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean)     | !==           | 9              | left → right      |
| [Bitwise and](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#bitwise-and-operator)                     | [Numeric](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric)     | &             | 10             | left → right      |
| [Boolean xor](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean#boolean-xor-operator)                     | [Boolean](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean)     | ^             | 11             | left → right      |
| [Bitwise xor](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#bitwise-xor-operator)                     | [Numeric](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric)     | ^             | 11             | left → right      |
| [Bitwise or](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric#bitwise-or-operator)                       | [Numeric](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-numeric)     |               | 12             | left → right      |
| [Boolean and](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean#boolean-and-operator)                     | [Boolean](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean)     | &&            | 13             | left → right      |
| [Boolean or](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean#boolean-or-operator)                       | [Boolean](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-boolean)     |               | 14             | left → right      |
| [Conditional](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-general#conditional-operator)                     | [General](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-general)     | ? :           | 15             | right → left      |
| [Elvis](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-reference#elvis-operator)                               | [General](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-general)     | ?:            | 16             | right → left      |
| [Assignment](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-general#assignment-operator)                       | [General](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-general)     | =             | 17             | right → left      |
| [Compound assignment](/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-general#compound-assignment-operator)     | [General](https://www.elastic.co/elastic/docs-builder/docs/2993/reference/scripting-languages/painless/painless-operators-general)     | $=            | 17             | right → left      |