Skip to content

Commit 12524b8

Browse files
authored
[DOCS] Fix ingest processor docs for autogen doc IDs (#60147) (#60244)
If you autogen doc IDs, you cannot use the `{{_id}}` value in an ingest processor. This adds a related admonition to the ingest processor docs.
1 parent 68db2f2 commit 12524b8

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

docs/reference/docs/index_.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ the index operation fails if a document with the specified ID
185185
already exists in the index.
186186

187187
[discrete]
188+
[[create-document-ids-automatically]]
188189
===== Create document IDs automatically
189190

190191
If you don't specify a document ID when using POST, the `op_type` is

docs/reference/ingest/ingest-node.asciidoc

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ You can access metadata fields in the same way that you access fields in the sou
6363
is possible because Elasticsearch doesn't allow fields in the source that have the
6464
same name as metadata fields.
6565

66+
The following metadata fields are accessible by a processor:
67+
68+
* `_index`
69+
* `_type`
70+
* `_id`
71+
* `_routing`
72+
6673
The following example sets the `_id` metadata field of a document to `1`:
6774

6875
[source,js]
@@ -76,7 +83,13 @@ The following example sets the `_id` metadata field of a document to `1`:
7683
--------------------------------------------------
7784
// NOTCONSOLE
7885

79-
The following metadata fields are accessible by a processor: `_index`, `_type`, `_id`, `_routing`.
86+
You can access a metadata field's value by surrounding it in double
87+
curly brackets `"{{ }}"`. For example, `{{_index}}` retrieves the name of a
88+
document's index.
89+
90+
WARNING: If you <<create-document-ids-automatically,automatically generate>>
91+
document IDs, you cannot use the `{{_id}}` value in an ingest processor. {es}
92+
assigns auto-generated `_id` values after ingest.
8093

8194
[discrete]
8295
[[accessing-ingest-metadata]]

0 commit comments

Comments
 (0)