2023-08-29 16:07:34 -04:00
---
layout: default
title: Lowercase
2023-10-17 17:22:28 -04:00
parent: Ingest processors
2023-08-29 16:07:34 -04:00
nav_order: 210
2023-10-17 17:22:28 -04:00
redirect_from:
- /api-reference/ingest-apis/processors/lowercase/
2023-08-29 16:07:34 -04:00
---
2023-12-05 14:49:46 -05:00
# Lowercase processor
2023-08-29 16:07:34 -04:00
2023-10-23 10:53:52 -04:00
The `lowercase` processor converts all the text in a specific field to lowercase letters.
2023-12-12 15:16:16 -05:00
## Syntax
2023-10-23 10:53:52 -04:00
The following is the syntax for the `lowercase` processor:
2023-08-29 16:07:34 -04:00
```json
{
"lowercase": {
"field": "field_name"
}
}
```
{% include copy-curl.html %}
2023-12-12 15:16:16 -05:00
## Configuration parameters
2023-08-29 16:07:34 -04:00
The following table lists the required and optional parameters for the `lowercase` processor.
2023-12-12 13:23:00 -05:00
| Parameter | Required | Description |
2023-08-29 16:07:34 -04:00
|---|---|---|
2023-12-12 13:23:00 -05:00
`field` | Required | The name of the field containing the data to be converted. Supports [template snippets ]({{site.url}}{{site.baseurl}}/ingest-pipelines/create-ingest/#template-snippets ). |
2023-08-29 16:07:34 -04:00
`description` | Optional | A brief description of the processor. |
2023-12-12 15:16:16 -05:00
`if` | Optional | A condition for running the processor. |
`ignore_failure` | Optional | Specifies whether the processor continues execution even if it encounters errors. If set to `true` , failures are ignored. Default is `false` . |
2023-08-29 16:07:34 -04:00
`on_failure` | Optional | A list of processors to run if the processor fails. |
2023-12-12 15:16:16 -05:00
`ignore_missing` | Optional | Specifies whether the processor should ignore documents that do not contain the specified field. If set to `true` , the processor does not modify the document if the field does not exist or is `null` . Default is `false` . |
2023-12-12 13:23:00 -05:00
`tag` | Optional | An identifier tag for the processor. Useful for debugging in order to distinguish between processors of the same type. |
2023-08-29 16:07:34 -04:00
`target_field` | Optional | The name of the field in which to store the parsed data. Default is `field` . By default, `field` is updated in place. |
## Using the processor
Follow these steps to use the processor in a pipeline.
2023-12-12 15:16:16 -05:00
**Step 1: Create a pipeline**
2023-08-29 16:07:34 -04:00
The following query creates a pipeline, named `lowercase-title` , that uses the `lowercase` processor to lowercase the `title` field of a document:
```json
PUT _ingest/pipeline/lowercase-title
{
"description" : "Pipeline that lowercases the title field",
"processors" : [
{
"lowercase" : {
"field" : "title"
}
}
]
}
```
{% include copy-curl.html %}
2023-12-12 15:16:16 -05:00
**Step 2 (Optional): Test the pipeline**
2023-08-29 16:07:34 -04:00
It is recommended that you test your pipeline before you ingest documents.
{: .tip}
To test the pipeline, run the following query:
```json
POST _ingest/pipeline/lowercase-title/_simulate
{
"docs": [
{
"_index": "testindex1",
"_id": "1",
"_source": {
"title": "WAR AND PEACE"
}
}
]
}
```
{% include copy-curl.html %}
2023-12-12 15:16:16 -05:00
**Response**
2023-08-29 16:07:34 -04:00
The following example response confirms that the pipeline is working as expected:
```json
{
"docs": [
{
"doc": {
"_index": "testindex1",
"_id": "1",
"_source": {
"title": "war and peace"
},
"_ingest": {
"timestamp": "2023-08-22T17:39:39.872671834Z"
}
}
}
]
}
```
2023-12-12 15:16:16 -05:00
**Step 3: Ingest a document**
2023-08-29 16:07:34 -04:00
The following query ingests a document into an index named `testindex1` :
```json
PUT testindex1/_doc/1?pipeline=lowercase-title
{
"title": "WAR AND PEACE"
}
```
{% include copy-curl.html %}
2023-12-12 15:16:16 -05:00
**Step 4 (Optional): Retrieve the document**
2023-08-29 16:07:34 -04:00
To retrieve the document, run the following query:
```json
GET testindex1/_doc/1
```
{% include copy-curl.html %}