Algolia CLI / Commands

Manage your Algolia indices.

algolia indices analyze

Usage
algolia indices analyze <index> [flags]

Display records statistics for the specified index.

Examples

1
2
3
4
5
6
7
8
9
10
11
12
# Display records statistics for the "MOVIES" index for the first 1000 records
$ algolia index analyze MOVIES

# Display records statistics for the "MOVIES" index without limit
$ algolia index analyze MOVIES --no-limit

# Display records statistics for the "MOVIES" index for the first 1000 records and output the result as JSON
$ algolia index analyze MOVIES -o json

# Display records statistics for the "MOVIES" index with the "actors" attribute only
$ algolia index analyze MOVIES --only actors

Advanced

--attributeCriteriaComputedByMinProximity

Whether the best matching attribute should be determined by minimum proximity.
See: https://www.algolia.com/doc/api-reference/api-parameters/attributeCriteriaComputedByMinProximity/

--distinct

Determines how many records of a group are included in the search results.
See: https://www.algolia.com/doc/api-reference/api-parameters/distinct/

--enableABTest

Whether to enable A/B testing for this search.
See: https://www.algolia.com/doc/api-reference/api-parameters/enableABTest/

--getRankingInfo

Whether the search response should include detailed ranking information.
See: https://www.algolia.com/doc/api-reference/api-parameters/getRankingInfo/

--maxFacetHits

Maximum number of facet values to return when searching for facet values.
See: https://www.algolia.com/doc/api-reference/api-parameters/maxFacetHits/

--minProximity

Minimum proximity score for two matching words.
See: https://www.algolia.com/doc/api-reference/api-parameters/minProximity/

--percentileComputation

Whether to include this search when calculating processing-time percentiles.
See: https://www.algolia.com/doc/api-reference/api-parameters/percentileComputation/

--renderingContent

Extra data that can be used in the search UI.
See: https://www.algolia.com/doc/api-reference/api-parameters/renderingContent/

--responseFields

Properties to include in the API response of search and browse requests.
See: https://www.algolia.com/doc/api-reference/api-parameters/responseFields/

--synonyms

Whether to take into account an index’s synonyms for this search.
See: https://www.algolia.com/doc/api-reference/api-parameters/synonyms/

Analytics

--analytics

Whether this search will be included in Analytics.
See: https://www.algolia.com/doc/api-reference/api-parameters/analytics/

--analyticsTags

Tags to apply to the query for segmenting analytics data.
See: https://www.algolia.com/doc/api-reference/api-parameters/analyticsTags/

--clickAnalytics

Whether to include a queryID attribute in the response.
See: https://www.algolia.com/doc/api-reference/api-parameters/clickAnalytics/

Attributes

--attributesToRetrieve

Attributes to include in the API response.
See: https://www.algolia.com/doc/api-reference/api-parameters/attributesToRetrieve/

Faceting

--facetingAfterDistinct

Whether faceting should be applied after deduplication with distinct.
See: https://www.algolia.com/doc/api-reference/api-parameters/facetingAfterDistinct/

--facets

Facets for which to retrieve facet values that match the search criteria and the number of matching facet values.
See: https://www.algolia.com/doc/api-reference/api-parameters/facets/

--maxValuesPerFacet

Maximum number of facet values to return for each facet.
See: https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/

--sortFacetValuesBy

Order in which to retrieve facet values.
See: https://www.algolia.com/doc/api-reference/api-parameters/sortFacetValuesBy/

Filtering

--enableReRanking

Whether this search will use Dynamic Re-Ranking.
See: https://www.algolia.com/doc/api-reference/api-parameters/enableReRanking/

--facetFilters

Filter the search by facet values, so that only records with the same facet values are retrieved.
See: https://www.algolia.com/doc/api-reference/api-parameters/facetFilters/

--filters

Filter expression to only include items that match the filter criteria in the response.
See: https://www.algolia.com/doc/api-reference/api-parameters/filters/

--numericFilters

Filter by numeric facets.
See: https://www.algolia.com/doc/api-reference/api-parameters/numericFilters/

--optionalFilters

Filters to promote or demote records in the search results.
See: https://www.algolia.com/doc/api-reference/api-parameters/optionalFilters/

--restrictSearchableAttributes

Restricts a search to a subset of your searchable attributes.
See: https://www.algolia.com/doc/api-reference/api-parameters/restrictSearchableAttributes/

--sumOrFiltersScores

Whether to sum all filter scores.
See: https://www.algolia.com/doc/api-reference/api-parameters/sumOrFiltersScores/

--tagFilters

Filter the search by values of the special _tags attribute.
See: https://www.algolia.com/doc/api-reference/api-parameters/tagFilters/

--aroundLatLng

Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude.
See: https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLng/

--aroundLatLngViaIP

Whether to obtain the coordinates from the request’s IP address.
See: https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLngViaIP/

--aroundPrecision

Precision of a coordinate-based search in meters to group results with similar distances.
See: https://www.algolia.com/doc/api-reference/api-parameters/aroundPrecision/

--aroundRadius

Maximum radius for a search around a central location.
See: https://www.algolia.com/doc/api-reference/api-parameters/aroundRadius/

--minimumAroundRadius

Minimum radius (in meters) for a search around a location when aroundRadius isn’t set.
See: https://www.algolia.com/doc/api-reference/api-parameters/minimumAroundRadius/

Highlighting and Snippeting

--attributesToHighlight

Attributes to highlight.
See: https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/

--attributesToSnippet

Attributes for which to enable snippets.
See: https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippet/

--highlightPostTag

HTML tag to insert after the highlighted parts in all highlighted results and snippets.
See: https://www.algolia.com/doc/api-reference/api-parameters/highlightPostTag/

--highlightPreTag

HTML tag to insert before the highlighted parts in all highlighted results and snippets.
See: https://www.algolia.com/doc/api-reference/api-parameters/highlightPreTag/

--replaceSynonymsInHighlight

Whether to replace a highlighted word with the matched synonym.
See: https://www.algolia.com/doc/api-reference/api-parameters/replaceSynonymsInHighlight/

--restrictHighlightAndSnippetArrays

Whether to restrict highlighting and snippeting to items that at least partially matched the search query.
See: https://www.algolia.com/doc/api-reference/api-parameters/restrictHighlightAndSnippetArrays/

--snippetEllipsisText

String used as an ellipsis indicator when a snippet is truncated.
See: https://www.algolia.com/doc/api-reference/api-parameters/snippetEllipsisText/

Languages

--decompoundQuery

Whether to split compound words into their building blocks.
See: https://www.algolia.com/doc/api-reference/api-parameters/decompoundQuery/

--ignorePlurals

Treat singular, plurals, and other forms of declensions as equivalent.
See: https://www.algolia.com/doc/api-reference/api-parameters/ignorePlurals/

--keepDiacriticsOnCharacters

Characters for which diacritics should be preserved.
See: https://www.algolia.com/doc/api-reference/api-parameters/keepDiacriticsOnCharacters/

--naturalLanguages

ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches).
See: https://www.algolia.com/doc/api-reference/api-parameters/naturalLanguages/

--queryLanguages

Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries.
See: https://www.algolia.com/doc/api-reference/api-parameters/queryLanguages/

--removeStopWords

Removes stop words from the search query.
See: https://www.algolia.com/doc/api-reference/api-parameters/removeStopWords/

Other flags

--cursor

Cursor to get the next page of the response.

-n, --no-limit

If set, the command will not limit the number of objects to analyze. Otherwise, the default limit is 1000 objects.

--only

If set, the command will only analyze the specified attribute. Chosen attribute values statistics will be shown in the output.

--reRankingApplyFilter

Restrict Dynamic Re-Ranking to records that match these filters.

--semanticSearch

Settings for the semantic search part of NeuralSearch.

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.

Pagination

--hitsPerPage

Number of hits per page.
See: https://www.algolia.com/doc/api-reference/api-parameters/hitsPerPage/

--length

Number of hits to retrieve (used in combination with offset).
See: https://www.algolia.com/doc/api-reference/api-parameters/length/

--offset

Position of the first hit to retrieve.
See: https://www.algolia.com/doc/api-reference/api-parameters/offset/

--page

Page of search results to retrieve.
See: https://www.algolia.com/doc/api-reference/api-parameters/page/

Personalization

--enablePersonalization

Indicates whether Personalization is enabled.

--personalizationImpact

Defines how much Personalization affects results.

--userToken

Unique pseudonymous or anonymous user identifier.
See: https://www.algolia.com/doc/api-reference/api-parameters/userToken/

Query strategy

--advancedSyntax

Whether to support phrase matching and excluding words from search queries.
See: https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntax/

--advancedSyntaxFeatures

Advanced search syntax features you want to support.
See: https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntaxFeatures/

--alternativesAsExact

Alternatives of query words that should be considered as exact matches by the Exact ranking criterion.
See: https://www.algolia.com/doc/api-reference/api-parameters/alternativesAsExact/

--disableExactOnAttributes

Searchable attributes for which you want to turn off the Exact ranking criterion.
See: https://www.algolia.com/doc/api-reference/api-parameters/disableExactOnAttributes/

--exactOnSingleWordQuery

Determines how the Exact ranking criterion is computed when the search query has only one word. One of: attribute, none, word.
See: https://www.algolia.com/doc/api-reference/api-parameters/exactOnSingleWordQuery/

--mode

Search mode the index will use to query for results. One of: neuralSearch, keywordSearch.
See: https://www.algolia.com/doc/api-reference/api-parameters/mode/

--optionalWords

Words that should be considered optional when found in the query.
See: https://www.algolia.com/doc/api-reference/api-parameters/optionalWords/

--queryType

Determines if and how query words are interpreted as prefixes. One of: prefixLast, prefixAll, prefixNone.
See: https://www.algolia.com/doc/api-reference/api-parameters/queryType/

--removeWordsIfNoResults

Strategy for removing words from the query when it doesn’t return any results. One of: none, lastWords, firstWords, allOptional.
See: https://www.algolia.com/doc/api-reference/api-parameters/removeWordsIfNoResults/

Ranking

--customRanking

Attributes to use as custom ranking.
See: https://www.algolia.com/doc/api-reference/api-parameters/customRanking/

--ranking

Determines the order in which Algolia returns your results.
See: https://www.algolia.com/doc/api-reference/api-parameters/ranking/

--relevancyStrictness

Relevancy threshold below which less relevant results aren’t included in the results.
See: https://www.algolia.com/doc/api-reference/api-parameters/relevancyStrictness/

Rules

--enableRules

Whether to enable rules.
See: https://www.algolia.com/doc/api-reference/api-parameters/enableRules/

--ruleContexts

Assigns a rule context to the search query.
See: https://www.algolia.com/doc/api-reference/api-parameters/ruleContexts/

--query

Search query.
See: https://www.algolia.com/doc/api-reference/api-parameters/query/

--similarQuery

Keywords to be used instead of the search query to conduct a more broader search.
See: https://www.algolia.com/doc/api-reference/api-parameters/similarQuery/

Typos

--allowTyposOnNumericTokens

Whether to allow typos on numbers in the search query.
See: https://www.algolia.com/doc/api-reference/api-parameters/allowTyposOnNumericTokens/

--disableTypoToleranceOnAttributes

Attributes for which you want to turn off typo tolerance.
See: https://www.algolia.com/doc/api-reference/api-parameters/disableTypoToleranceOnAttributes/

--minWordSizefor1Typo

Minimum number of characters a word in the search query must contain to accept matches with one typo.
See: https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor1Typo/

--minWordSizefor2Typos

Minimum number of characters a word in the search query must contain to accept matches with two typos.
See: https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor2Typos/

--typoTolerance

Whether typo tolerance is enabled and how it is applied.
See: https://www.algolia.com/doc/api-reference/api-parameters/typoTolerance/

algolia indices clear

Usage
algolia indices clear <index> [flags]

Clear the specified index.

Examples

1
2
3
# Clear the index named "MOVIES"
$ algolia index clear MOVIES

Flags

-y, --confirm

skip confirmation prompt

algolia indices config

Usage
algolia indices config [flags]

Manage your Algolia index config (settings, synonyms, rules).

algolia indices config export

Usage
algolia indices config export <index> [--scope <scope>...] [--directory] [flags]

Export an index configuration (settings, synonyms, rules) to a file.

Examples

1
2
3
4
5
6
7
8
9
# Export the config of the index 'MOVIES' to a .json in the current folder
$ algolia index config export MOVIES

# Export the synonyms and rules of the index 'MOVIES' to a .json in the current folder
$ algolia index config export MOVIES --scope synonyms,rules

# Export the config of the index 'MOVIES' to a .json into 'exports' folder
$ algolia index config export MOVIES --directory exports

Flags

-d, --directory

Directory path of the output file (default: current folder)

-s, --scope

Scope to export (default: all)

algolia indices config import

Usage
algolia indices config import <index> -F <file> --scope <scope>... [flags]

Import an index configuration (settings, synonyms, rules) from a file.

Examples

1
2
3
4
5
6
7
8
9
10
11
12
# Import the config from a .json file into 'PROD_MOVIES' index
$ algolia index config import PROD_MOVIES -F export-STAGING_MOVIES-APP_ID-1666792448.json

# Import only the synonyms and settings from a .json file to the 'PROD_MOVIES' index
$ algolia index config import PROD_MOVIES -F export-STAGING_MOVIES-APP_ID-1666792448.json --scope synonyms, settings

# Import only the synonyms from a .json file to the 'PROD_MOVIES' index and clear all existing ones
$ algolia index config import PROD_MOVIES -F export-STAGING_MOVIES-APP_ID-1666792448.json --scope synonyms --clear-existing-synonyms

# Import only the rules from a .json file to the 'PROD_MOVIES' index and clear all existing ones
$ algolia index config import PROD_MOVIES -F export-STAGING_MOVIES-APP_ID-1666792448.json --scope rules --clear-existing-rules

Flags

-r, --clear-existing-rules

Clear ALL existing rules of the index before import

-o, --clear-existing-synonyms

Clear ALL existing synonyms of the index before import

-y, --confirm

Skip confirmation prompt

-F, --file

Directory path of the JSON config file

-l, --forward-rules-to-replicas

Forward imported rules to replicas

-t, --forward-settings-to-replicas

Forward imported settings to replicas

-m, --forward-synonyms-to-replicas

Forward imported synonyms to replicas

-s, --scope

Scope to import (default: none)

algolia indices copy

Usage
algolia indices copy <source-index> <destination-index> [flags]

Make a copy of an index.

Examples

1
2
3
4
5
6
7
8
9
# Copy the records, settings, synonyms and rules from the "SERIES" index to the "MOVIES" index
$ algolia indices copy SERIES MOVIES

# Copy only the synonyms of the "SERIES" to the "MOVIES" index
$ algolia indices copy SERIES MOVIES --scope synonyms

# Copy the synonyms and rules of the index "SERIES" to the "MOVIES" index
$ algolia indices copy SERIES MOVIES --scope synonyms,rules

Flags

-y, --confirm

skip confirmation prompt

-s, --scope

scope to copy (default: all)

-w, --wait

wait for the operation to complete

algolia indices delete

Usage
algolia indices delete <index> [flags]

Delete one or multiple indices.

Examples

1
2
3
4
5
6
7
8
9
10
11
12
# Delete the index named "MOVIES"
$ algolia indices delete MOVIES

   # Delete the index named "MOVIES" and its replicas
   $ algolia indices delete MOVIES --includeReplicas

# Delete the index named "MOVIES", skipping the confirmation prompt
$ algolia indices delete MOVIES -y

# Delete multiple indices
$ algolia indices delete MOVIES SERIES ANIMES

Flags

-y, --confirm

skip confirmation prompt

-r, --includeReplicas

delete replica indices too

algolia indices list

Usage
algolia indices list [flags]

List indices.

Examples

1
2
3
# List indices
$ algolia indices list

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 indices move

Usage
algolia indices move <source-index> <destination-index> [flags]

Move an index.

Examples

1
2
3
# Move the "TEST_MOVIES" index to "DEV_MOVIES"
$ algolia indices move TEST_MOVIES DEV_MOVIES

Flags

-y, --confirm

skip confirmation prompt

-w, --wait

wait for the operation to complete

Did you find this page helpful?