Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,9 @@ Before diving into the dispatch process, here a brief definition of the main con
* **Arity:** The number of parameters the method accepts. In `s.foo(a, b)` the arity is 2
* **Dispatch:** The process of determining which method implementation to execute based on the receiver, name, and arity

:::{image} images/painless-method-dispatching.png
:alt: Flowchart showing five steps: s.foo, receiver, name, arity, and execute method
:width: 250px
:::

<!--
:::{diagram} mermaid
```mermaid
flowchart TD
A[s.foo#40;a, b#41;] --> B[Receiver: type of 's']
A[s.foo(a, b)] --> B[Receiver: type of 's']
B --> C[Name: method 'foo']
C --> D[Arity: 2 parameters]
D --> E[Execute method]
Expand All @@ -41,9 +35,7 @@ flowchart TD
style C fill:#F5F7FA,stroke:#101C3F,color:#101C3F
style D fill:#F5F7FA,stroke:#101C3F,color:#101C3F
style E fill:#02BCB7,color:#fff
:::
-->

```

## Why method dispatch matters

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ For information about basic constructs that Painless and Java share, refer to co

Painless scripts are parsed and compiled using the [ANTLR4](https://www.antlr.org/) and [ASM](https://asm.ow2.org/) libraries. Scripts are compiled directly into Java Virtual Machine (JVM) bytecode and executed against a standard JVM.

:::{image} images/painless-compilation-process.png
:alt: Painless compilation process
:::

<!--
:::{diagram} mermaid
```mermaid
flowchart LR
A[Painless Script] --> B[ANTLR4 & ASM<br/>parsing & compilation]
B --> C[JVM Bytecode]
Expand All @@ -48,8 +43,7 @@ flowchart LR
class B lightTeal
class C lightPoppy
class D pink
:::
-->
```

### Step breakdown:

Expand All @@ -73,16 +67,12 @@ This context-aware design allows Painless to optimize performance and security f

Understanding context-syntax relationships is essential for effective Painless development. For detailed information about context-syntax patterns and practical examples, refer to [Painless syntax-context bridge](docs-content://explore-analyze/scripting/painless-syntax-context-bridge.md).

:::{image} images/painless-integration-points.png
:alt: Painless integration-points
:::
Double-click to expand the image.

<!--
:::{diagram} mermaid
```mermaid
flowchart TD
A[Painless Scripts] --> B[Dev Tools Console]
A[Painless Scripts] --> B[Dev Tools Console <a href='http://google.com'>test link</a>]
link B "docs-content://explore-analyze/query-filter/tools/console.md" _blank
A --> C[Ingest Pipelines]
link C "https://www.elastic.co/docs/manage-data/ingest/transform-enrich/ingest-pipelines" "Elasticsearch Ingest Pipelines"
A --> D[Update API]
A --> E[Search Queries]
A --> F[Runtime Fields]
Expand Down Expand Up @@ -115,9 +105,7 @@ flowchart TD
style G1 fill:#F990C6,color:#000
style H1 fill:#7DD3D0,color:#000
style I1 fill:#A1D1FF,color:#000
:::
-->

```

### Where to write Painless scripts:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,7 @@ Painless operators use Java-like syntax with {{es}} specific enhancements such a

Painless organizes operators into five functional categories based on their purpose.

:::{image} images/painless-operator-categories.png
:alt: Painless operator categories
:::
Double-click to expand the image.

<!--
:::{diagram} mermaid
```mermaid
graph TB
A["Painless Operators"]

Expand Down Expand Up @@ -69,9 +63,7 @@ graph TB
class B,C,D,E,F categoryBox
class B1,C1,D1,E1,F1 descBox
class B2,C2,D2,E2,F2 exampleBox
:::
-->

```

### General operators

Expand Down
Loading