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

# algolia synonyms import

> Import synonyms to the index.

```txt Usage theme={"system"}
algolia synonyms import <index> -F <file> [flags]
```

## Examples

Import synonyms from the "synonyms.ndjson" file to the "MOVIES" index:

```sh icon=square-terminal theme={"system"}
algolia synonyms import MOVIES -F synonyms.ndjson
```

Import synonyms from the standard input to the "MOVIES" index:

```sh icon=square-terminal theme={"system"}
cat synonyms.ndjson | algolia synonyms import MOVIES -F -
```

Browse the synonyms in the "SERIES" index and import them to the "MOVIES" index:

```sh icon=square-terminal theme={"system"}
algolia synonyms browse SERIES | algolia synonyms import MOVIES -F -
```

Import synonyms from the "synonyms.ndjson" file to the "MOVIES" index and replace existing synonyms:

```sh icon=square-terminal theme={"system"}
algolia synonyms import MOVIES -F synonyms.ndjson -r
```

Import synonyms from the "synonyms.ndjson" file to the "MOVIES" index and don't forward the synonyms to the index replicas:

```sh icon=square-terminal theme={"system"}
algolia synonyms import MOVIES -F synonyms.ndjson -f=false
```

## Flags

<ParamField body="--dry-run">
  Validate and preview the import request without sending it
</ParamField>

<ParamField body="-F, --file">
  Import synonyms from a `file` (use "-" to read from standard input)
</ParamField>

<ParamField body="-f, --forward-to-replicas">
  Whether to also add the synonyms to replicas
</ParamField>

<ParamField body="-r, --replace-existing-synonyms">
  Replace existing synonyms in the index
</ParamField>

<ParamField body="-w, --wait">
  wait for the operation to complete
</ParamField>

## Output formatting flags

<ParamField body="--allow-missing-template-keys">
  If true, ignore errors in templates due to missing fields or map keys. This only applies to golang and jsonpath output formats.
</ParamField>

<ParamField body="-o, --output">
  Output format. One of: (json, jsonl, ndjson, jsonpath, jsonpath-as-json, jsonpath-file).
</ParamField>

<ParamField body="--template">
  Template string or path to a template file to use when --output=jsonpath, --output=jsonpath-file.
</ParamField>
