This version of the OpenSearch documentation is no longer maintained. For the latest version, see the current documentation. For information about OpenSearch version maintenance, see Release Schedule and Maintenance Policy.

Lowercase

The lowercase processor converts all the text in a specific field to lowercase letters. The following is the syntax for the lowercase processor:

  1. {
  2. "lowercase": {
  3. "field": "field_name"
  4. }
  5. }

copy

Configuration parameters

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

NameRequiredDescription
fieldRequiredThe name of the field that contains the data to be converted. Supports template snippets.
descriptionOptionalA brief description of the processor.
ifOptionalA condition for running this processor.
ignore_failureOptionalIf set to true, failures are ignored. Default is false.
on_failureOptionalA list of processors to run if the processor fails.
ignore_missingOptionalSpecifies whether the processor should ignore documents that do not have the specified field. Default is false.
tagOptionalAn identifier tag for the processor. Useful for debugging to distinguish between processors of the same type.
target_fieldOptionalThe 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.

Step 1: Create a pipeline.

The following query creates a pipeline, named lowercase-title, that uses the lowercase processor to lowercase the title field of a document:

  1. PUT _ingest/pipeline/lowercase-title
  2. {
  3. "description" : "Pipeline that lowercases the title field",
  4. "processors" : [
  5. {
  6. "lowercase" : {
  7. "field" : "title"
  8. }
  9. }
  10. ]
  11. }

copy

Step 2 (Optional): Test the pipeline.

It is recommended that you test your pipeline before you ingest documents.

To test the pipeline, run the following query:

  1. POST _ingest/pipeline/lowercase-title/_simulate
  2. {
  3. "docs": [
  4. {
  5. "_index": "testindex1",
  6. "_id": "1",
  7. "_source": {
  8. "title": "WAR AND PEACE"
  9. }
  10. }
  11. ]
  12. }

copy

Response

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

  1. {
  2. "docs": [
  3. {
  4. "doc": {
  5. "_index": "testindex1",
  6. "_id": "1",
  7. "_source": {
  8. "title": "war and peace"
  9. },
  10. "_ingest": {
  11. "timestamp": "2023-08-22T17:39:39.872671834Z"
  12. }
  13. }
  14. }
  15. ]
  16. }

Step 3: Ingest a document.

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

  1. PUT testindex1/_doc/1?pipeline=lowercase-title
  2. {
  3. "title": "WAR AND PEACE"
  4. }

copy

Step 4 (Optional): Retrieve the document.

To retrieve the document, run the following query:

  1. GET testindex1/_doc/1

copy