algolia rules
Manage your Algolia rules.
algolia rules browse
algolia rules browse <index> [flags]
List an indices’ rules.
Examples
1
2
3
4
5
6
# List all the rules of the "MOVIES" index
$ algolia rules browse MOVIES
# List all the rules of the "MOVIES" index and save them to a 'rules.ndjson' file
$ algolia rules browse MOVIES -o json > rules.ndjson
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 rules delete
algolia rules delete <index> --rule-ids <rule-ids> --confirm [flags]
Delete an indices’ rules.
Examples
1
2
3
4
5
6
# Delete one single rule with the ID "1" from the "MOVIES" index
$ algolia rules delete MOVIES --rule-ids 1
# Delete multiple rules with the IDs "1" and "2" from the "MOVIES" index
$ algolia rules delete MOVIES --rule-ids 1,2
Flags
-
-y,--confirm -
Skip confirmation prompt
-
--forward-to-replicas -
Whether to also delete the rules from the replicas
-
--rule-ids -
Rule IDs to delete
-
-w,--wait -
Wait for the operation to complete
algolia rules import
algolia rules import <index> -F <file> [flags]
Import Rules into an index.
Examples
1
2
3
4
5
6
7
8
9
10
11
12
# Import rules from the "rules.ndjson" file to the "MOVIES" index
$ algolia rules import MOVIES -F rules.ndjson
# Import rules from the standard input to the "MOVIES" index
$ cat rules.ndjson | algolia rules import MOVIES -F -
# Browse the rules in the "SERIES" index and import them to the "MOVIES" index
$ algolia rules browse SERIES | algolia rules import MOVIES -F -
# Import rules from the "rules.ndjson" file to the "MOVIES" index and don't forward them to the index replicas
$ algolia rules import MOVIES -F rules.ndjson -f=false
Flags
-
-c,--clear-existing-rules -
Delete existing rules before importing new ones
-
-y,--confirm -
Skip the confirmation prompt.
-
-F,--file -
Import rules from a
file(use “-“ to read from standard input) -
-f,--forward-to-replicas -
Whether to add the rules to replica indices
-
-w,--wait -
wait for the operation to complete