Algolia CLI / Commands

Manage your Algolia synonyms.

algolia synonyms browse

Usage
algolia synonyms browse <index> [flags]

List all the the synonyms of the given index.

Examples

1
2
3
4
5
6
# List all the synonyms of the 'TEST_PRODUCTS_1' index
$ algolia synonyms browse TEST_PRODUCTS_1

# List all the synonyms of the 'TEST_PRODUCTS_1' and save them to the 'synonyms.json' file
$ algolia synonyms browse TEST_PRODUCTS_1 > synonyms.json

Output formatting flags

--allow-missing-template-keys

If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.

-o, --output

Output format. One of: (json, jsonpath, jsonpath-as-json, jsonpath-file).

--template

Template string or path to template file to use when –output=jsonpath, –output=jsonpath-file.

algolia synonyms delete

Usage
algolia synonyms delete <index> --synonyms <synonym-ids> --confirm [flags]

Delete synonyms from an index.

Examples

1
2
3
4
5
6
# Delete one single synonym with the ID "1" from the "TEST_PRODUCTS_1" index
$ algolia synonyms delete TEST_PRODUCTS_1 --synonym-ids 1

# Delete multiple synonyms with the IDs "1" and "2" from the "TEST_PRODUCTS_1" index
$ algolia synonyms delete TEST_PRODUCTS_1 --synonym-ids 1 2

Flags

-y, --confirm

skip confirmation prompt.

--forward-to-replicas

Forward the delete request to the replicas.

--synonym-ids

Synonym IDs to delete.

algolia synonyms import

Usage
algolia synonyms import <index> -F <file> [flags]

Import synonyms to the index.

Examples

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Import synonyms from the "synonyms.ndjson" file to the "TEST_PRODUCTS_1" index
$ algolia synonyms import TEST_PRODUCTS_1 -F synonyms.ndjson

# Import synonyms from the standard input to the "TEST_PRODUCTS_1" index
$ cat synonyms.ndjson | algolia synonyms import TEST_PRODUCTS_1 -F -

# Browse the synonyms in the "TEST_PRODUCTS_1" index and import them to the "TEST_PRODUCTS_2" index
$ algolia synonyms browse TEST_PRODUCTS_1 | algolia synonyms import TEST_PRODUCTS_2 -F -

# Import synonyms from the "synonyms.ndjson" file to the "TEST_PRODUCTS_1" index and replace existing synonyms
$ algolia synonyms import TEST_PRODUCTS_1 -F synonyms.ndjson -r

# Import synonyms from the "synonyms.ndjson" file to the "TEST_PRODUCTS_1" index and don't forward the synonyms to the index replicas
$ algolia synonyms import TEST_PRODUCTS_1 -F synonyms.ndjson -f=false

Flags

-F, --file

Read synonyms to import from file (use “-“ to read from standard input).

-f, --forward-to-replicas

Forward the synonyms to the replicas of the index.

-r, --replace-existing-synonyms

Replace existing synonyms in the index.

Did you find this page helpful?