Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add foreach processor documentation #5981

Merged
merged 12 commits into from
May 28, 2024
86 changes: 86 additions & 0 deletions _ingest-pipelines/processors/foreach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
layout: default
title: Foreach
parent: Ingest processors
nav_order: 110
---

# Foreach processor

Check failure on line 8 in _ingest-pipelines/processors/foreach.md

View workflow job for this annotation

GitHub Actions / vale

[vale] _ingest-pipelines/processors/foreach.md#L8

[OpenSearch.Spelling] Error: Foreach. If you are referencing a setting, variable, format, function, or repository, surround it with tic marks.
Raw output
{"message": "[OpenSearch.Spelling] Error: Foreach. If you are referencing a setting, variable, format, function, or repository, surround it with tic marks.", "location": {"path": "_ingest-pipelines/processors/foreach.md", "range": {"start": {"line": 8, "column": 3}}}, "severity": "ERROR"}

The `foreach` processor is used to <explain what is used to do>.

The following is the syntax for the `foreach` processor:

```json
<insert syntax example>
```
{% include copy-curl.html %}

## Configuration parameters

The following table lists the required and optional parameters for the `foreach` processor.

Parameter | Required/Optional | Description |
|-----------|-----------|-----------|
<insert the parameters>

vagimeli marked this conversation as resolved.
Show resolved Hide resolved
## Using the processor

Follow these steps to use the processor in a pipeline.

### Step 1: Create a pipeline
vagimeli marked this conversation as resolved.
Show resolved Hide resolved

The following query creates a pipeline, named <name>, that uses the `foreach` processor to <do what?>:

```json
<insert pipeline code example>
```
{% include copy-curl.html %}

### Step 2 (Optional): Test the pipeline

It is recommended that you test your pipeline before you ingest documents.
{: .tip}

To test the pipeline, run the following query:

```json
<insert code example>
vagimeli marked this conversation as resolved.
Show resolved Hide resolved
```
{% include copy-curl.html %}

#### Response

The following example response confirms that the pipeline is working as expected:

```json
<insert response example>
```

### Step 3: Ingest a document

The following query ingests a document into an index named `testindex1`:

```json
<insert code example>
```
{% include copy-curl.html %}

#### Response

The request indexes the document into the index <index name> and will index all documents with <what does this response tell the user?>.

```json
<insert code example>
```

### Step 4 (Optional): Retrieve the document

To retrieve the document, run the following query:

```json
<insert code example>
```
{% include copy-curl.html %}

<Provide any other information and code examples relevant to the user or use cases.>
Loading