> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# customNormalization

> Provide a custom character normalization

export const Setting = ({type, default: defaultValue, defaultNote, scope, min, max, formerly}) => {
  const renderedDefault = defaultValue === '' ? '""' : defaultValue;
  const renderedNote = defaultNote ? `(${defaultNote})` : '';
  return <ul>
      <li><strong>Type:</strong> <code>{type}</code></li>
      <li><strong>Default:</strong> <code>{renderedDefault}</code>{renderedNote}</li>
      {min && <li><strong>Min:</strong> <code>{min}</code></li>}
      {max && <li><strong>Max:</strong> <code>{max}</code></li>}
      <li><strong>Scope:</strong> <a href="/doc/api-reference/api-parameters"><code>{scope}</code></a></li>
      {formerly && <li>
          <strong>Deprecated name:</strong> <code>{formerly}</code>
        </li>}
    </ul>;
};

<Setting type="object" default="{}" scope="settings" />

The `customNormalization` parameter lets you define how Algolia should transform specific characters.

## Usage

* The **input** of a custom normalization must contain a single character.
* The **output** of a custom normalization must have at most two characters.
* Doesn't apply to decomposed Unicode characters that use combining marks.\
  For example:

  * You **can't** normalize `ü` if it's encoded as `u` (U+0075) + `◌̈` (U+0308).
  * You **can** normalize `ü` if it's the represented by the character `ü` (U+00FC).

## Example

<AccordionGroup>
  <Accordion title="Current API clients" defaultOpen="true">
    <CodeGroup>
      ```cs C# theme={"system"}
      var response = await client.SetSettingsAsync(
        "INDEX_NAME",
        new IndexSettings
        {
          CustomNormalization = new Dictionary<string, Dictionary<string, string>>
          {
            {
              "default",
              new Dictionary<string, string> { { "ä", "ae" } }
            },
          },
        }
      );
      ```

      ```dart Dart theme={"system"}
      final response = await client.setSettings(
        indexName: "INDEX_NAME",
        indexSettings: IndexSettings(
          customNormalization: {
            'default': {
              'ä': "ae",
            },
          },
        ),
      );
      ```

      ```go Go theme={"system"}
      response, err := client.SetSettings(client.NewApiSetSettingsRequest(
        "INDEX_NAME",
        search.NewEmptyIndexSettings().SetCustomNormalization(map[string]map[string]string{"default": {"ä": "ae"}})))
      if err != nil {
        // handle the eventual error
        panic(err)
      }
      ```

      ```java Java theme={"system"}
      UpdatedAtResponse response = client.setSettings(
        "INDEX_NAME",
        new IndexSettings().setCustomNormalization(
          new HashMap() {
            {
              put(
                "default",
                new HashMap() {
                  {
                    put("ä", "ae");
                  }
                }
              );
            }
          }
        )
      );
      ```

      ```js JavaScript theme={"system"}
      const response = await client.setSettings({
        indexName: 'theIndexName',
        indexSettings: { customNormalization: { default: { ä: 'ae' } } },
      });
      ```

      ```kotlin Kotlin theme={"system"}
      var response =
        client.setSettings(
          indexName = "INDEX_NAME",
          indexSettings = IndexSettings(customNormalization = mapOf("default" to mapOf("ä" to "ae"))),
        )
      ```

      ```php PHP theme={"system"}
      $response = $client->setSettings(
          'INDEX_NAME',
          ['customNormalization' => ['default' => ['ä' => 'ae',
          ],
          ],
          ],
      );
      ```

      ```python Python theme={"system"}
      response = client.set_settings(
          index_name="INDEX_NAME",
          index_settings={
              "customNormalization": {
                  "default": {
                      "ä": "ae",
                  },
              },
          },
      )
      ```

      ```ruby Ruby theme={"system"}
      response = client.set_settings(
        "INDEX_NAME",
        Algolia::Search::IndexSettings.new(custom_normalization: {default: {ä: "ae"}})
      )
      ```

      ```scala Scala theme={"system"}
      val response = Await.result(
        client.setSettings(
          indexName = "INDEX_NAME",
          indexSettings = IndexSettings(
            customNormalization = Some(Map("default" -> Map("ä" -> "ae")))
          )
        ),
        Duration(100, "sec")
      )
      ```

      ```swift Swift theme={"system"}
      let response = try await client.setSettings(
          indexName: "INDEX_NAME",
          indexSettings: IndexSettings(customNormalization: ["default": ["ä": "ae"]])
      )
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Legacy API clients">
    <CodeGroup>
      ```cs C# theme={"system"}
      IndexSettings settings = new IndexSettings();

      settings.CustomNormalization =
      new Dictionary>
      {
        { "default", new Dictionary { {"ä", "ae"} } }
      };

      index.SetSettings(settings);
      ```

      ```go Go theme={"system"}
      res, err := index.SetSettings(search.Settings{
      	CustomNormalization: opt.CustomNormalization(map[string]map[string]string{
      		"default": {"ä": "ae"},
      	}),
      })
      ```

      ```java Java theme={"system"}
      IndexSettings settings = new IndexSettings();

      settings.setCustomNormalization(
        new HashMap>() {
          {
            put(
                "default",
                new HashMap() {
                  {
                    put("ä", "ae");
                  }
                });
          }
        });

        index.setSettings(settings);
      ```

      ```js JavaScript theme={"system"}
      index
        .setSettings({
          customNormalization: {
            default: { ä: "ae" },
          },
        })
        .then(() => {
          // done
        });
      ```

      ```kotlin Kotlin theme={"system"}
      val settings = settings {
          customNormalization = mapOf(
              "default" to mapOf(
                  "ä" to "ae",
                  "ü" to "ue"
              )
          )
      }

      index.setSettings(settings)
      ```

      ```php PHP theme={"system"}
      $index->setSettings([
          'customNormalization' => [
              'default' => [
                  'ä' => 'ae'
              ]
          ]
      ]);
      ```

      ```python Python theme={"system"}
      index.set_settings(
          {
              "custom_normalization": {
                  "default": {"ä": "ae"},
              },
          }
      )
      ```

      ```ruby Ruby theme={"system"}
      index.set_settings(
        {
          :"customNormalization" => {
            default: {:"ä" => "ae"}
          }
        }
      )
      ```

      ```scala Scala theme={"system"}
      client.execute {
        setSettings of "myIndex" `with` IndexSettings(
        customNormalization = Some(Map("default" -> Map("ä" -> "ae")))
        )
      }
      ```

      ```swift Swift theme={"system"}
      let settings = Settings()
        .set(\.customNormalization, to: [
          "default": [
            "ä": "ae",
            "ü": "ue"
          ]
        ])

      index.setSettings(settings) { result in
        if case .success(let response) = result {
          print("Response: \(response)")
        }
      }
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>
