algolia synonyms
Manage your Algolia synonyms.
algolia synonyms browse
algolia synonyms browse <index> [flags]
List all synonyms in this index.
Examples
1
2
3
4
5
6
# List all the synonyms in the 'MOVIES' index
$ algolia synonyms browse MOVIES
# List all the synonyms in the 'MOVIES' index and save them in the 'synonyms.json' file
$ algolia synonyms browse MOVIES > synonyms.json
Output formatting flags
-
--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.
-
-o,--output -
Output format. One of: (json, jsonpath, jsonpath-as-json, jsonpath-file).
-
--template -
Template string or path to a template file to use when –output=jsonpath, –output=jsonpath-file.
algolia synonyms delete
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 "MOVIES" index
$ algolia synonyms delete MOVIES --synonym-ids 1
# Delete multiple synonyms with the IDs "1" and "2" from the "MOVIES" index
$ algolia synonyms delete MOVIES --synonym-ids 1,2
Flags
-
-y,--confirm -
Skip confirmation prompt
-
--forward-to-replicas -
Whether to delete synonyms also from the replicas
-
--synonym-ids -
Synonym IDs to delete.
-
-w,--wait -
Wait for the operation to complete
algolia synonyms import
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 "MOVIES" index
$ algolia synonyms import MOVIES -F synonyms.ndjson
# Import synonyms from the standard input to the "MOVIES" index
$ cat synonyms.ndjson | algolia synonyms import MOVIES -F -
# Browse the synonyms in the "SERIES" index and import them to the "MOVIES" index
$ algolia synonyms browse SERIES | algolia synonyms import MOVIES -F -
# Import synonyms from the "synonyms.ndjson" file to the "MOVIES" index and replace existing synonyms
$ 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
$ algolia synonyms import MOVIES -F synonyms.ndjson -f=false
Flags
-
-F,--file -
Import synonyms from a
file(use “-“ to read from standard input) -
-f,--forward-to-replicas -
Whether to also add the synonyms to replicas
-
-r,--replace-existing-synonyms -
Replace existing synonyms in the index
-
-w,--wait -
wait for the operation to complete
algolia synonyms save
algolia synonyms save <index> --id <id> --synonyms <synonyms> [flags]
Add a synonym to an index.
Examples
1
2
3
# Save one standard synonym with ID "1" and "foo" and "bar" synonyms to the "MOVIES" index
$ algolia synonyms save MOVIES --id 1 --synonyms foo,bar
Flags
-
-c,--corrections -
A list of corrections of the word (alt correction synonyms only)
-
-f,--forward-to-replicas -
Whether to add the synoynm to replicas
-
-i,--id -
Synonym ID to save
-
-n,--input -
Word of phrases to appear in query strings (one-way synonyms only)
-
-l,--placeholder -
Placeholder token to represent a synonym within records
-
-r,--replacements -
Query words that will match the placeholder synonym token
-
-s,--synonyms -
Synonyms to save
-
-t,--type -
Synonym type to save (default to regular)
-
--wait -
Wait for the operation to complete
-
-w,--word -
A single word, used as the basis for the array of corrections (alt-correction synonyms only)