Skip to main content
Usage
algolia search <index> [flags]

Examples

Search for records in the “MOVIES” index matching the query “toy story”:
algolia search MOVIES --query "toy story"
Search for records in the “MOVIES” index matching the query “toy story” with filters:
algolia search MOVIES --query "toy story" --filters "'(genres:Animation OR genres:Family) AND original_language:en'"
Search for records in the “MOVIES” index matching the query “toy story” while setting the number of hits per page and specifying the page to retrieve:
algolia search MOVIES --query "toy story" --hitsPerPage 2 --page 4
Search for records in the “MOVIES” index matching the query “toy story” and export the response to a .json file:
algolia search MOVIES --query "toy story" > movies.json
Search for records in the “MOVIES” index matching the query “toy story” and only export the results to a .json file:
algolia search MOVIES --query "toy story" --output="jsonpath={$.Hits}" > movies.json
Search for records in the “MOVIES” index while keeping the response small:
algolia search MOVIES --query "toy story" --responseFields hits,nbHits,page --attributesToRetrieve title,overview

Advanced

--attributeCriteriaComputedByMinProximity
Whether the best matching attribute should be determined by minimum proximity. See: attributeCriteriaComputedByMinProximity
--distinct
Determines how many records of a group are included in the search results. See: distinct
--enableABTest
Whether to enable A/B testing for this search. See: enableABTest
--getRankingInfo
Whether the search response should include detailed ranking information. See: getRankingInfo
--minProximity
Minimum proximity score for two matching words. See: minProximity
--percentileComputation
Whether to include this search when calculating processing-time percentiles. See: percentileComputation
--renderingContent
Extra data that can be used in the search UI. See: renderingContent
--responseFields
Properties to include in the API response of search and browse requests. See: responseFields
--synonyms
Whether to take into account an index’s synonyms for this search. See: synonyms

Analytics

--analytics
Whether this search will be included in Analytics. See: analytics
--analyticsTags
Tags to apply to the query for segmenting analytics data. See: analyticsTags
--clickAnalytics
Whether to include a queryID attribute in the response. See: clickAnalytics

Attributes

--attributesToRetrieve
Attributes to include in the API response. See: attributesToRetrieve

Faceting

--facetingAfterDistinct
Whether faceting should be applied after deduplication with distinct. See: facetingAfterDistinct
--facets
Facets for which to retrieve facet values that match the search criteria and the number of matching facet values. See: facets
--maxValuesPerFacet
Maximum number of facet values to return for each facet. See: maxValuesPerFacet
--sortFacetValuesBy
Order in which to retrieve facet values. See: sortFacetValuesBy

Filtering

--enableReRanking
Whether this search will use Dynamic Re-Ranking. See: enableReRanking
--facetFilters
Filter the search by facet values, so that only records with the same facet values are retrieved. See: facetFilters
--filters
Filter expression to only include items that match the filter criteria in the response. See: filters
--numericFilters
Filter by numeric facets. See: numericFilters
--optionalFilters
Filters to promote or demote records in the search results. See: optionalFilters
--restrictSearchableAttributes
Restricts a search to a subset of your searchable attributes. See: restrictSearchableAttributes
--sumOrFiltersScores
Whether to sum all filter scores. See: sumOrFiltersScores
--tagFilters
Filter the search by values of the special _tags attribute. See: tagFilters
--aroundLatLng
Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. See: aroundLatLng
--aroundLatLngViaIP
Whether to obtain the coordinates from the request’s IP address. See: aroundLatLngViaIP
--aroundPrecision
Precision of a coordinate-based search in meters to group results with similar distances. See: aroundPrecision
--aroundRadius
Maximum radius for a search around a central location. See: aroundRadius
--minimumAroundRadius
Minimum radius (in meters) for a search around a location when aroundRadius isn’t set. See: minimumAroundRadius

Highlighting and Snippeting

--attributesToHighlight
Attributes to highlight. See: attributesToHighlight
--attributesToSnippet
Attributes for which to enable snippets. See: attributesToSnippet
--highlightPostTag
HTML tag to insert after the highlighted parts in all highlighted results and snippets. See: highlightPostTag
--highlightPreTag
HTML tag to insert before the highlighted parts in all highlighted results and snippets. See: highlightPreTag
--replaceSynonymsInHighlight
Whether to replace a highlighted word with the matched synonym. See: replaceSynonymsInHighlight
--restrictHighlightAndSnippetArrays
Whether to restrict highlighting and snippeting to items that at least partially matched the search query. See: restrictHighlightAndSnippetArrays
--snippetEllipsisText
String used as an ellipsis indicator when a snippet is truncated. See: snippetEllipsisText

Languages

--decompoundQuery
Whether to split compound words in the query into their building blocks. See: decompoundQuery
--ignorePlurals
Treat singular, plurals, and other forms of declensions as equivalent. See: ignorePlurals
--naturalLanguages
ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches). See: naturalLanguages
--queryLanguages
Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. See: queryLanguages
--removeStopWords
Removes stop words from the search query. See: removeStopWords

Other flags

--insideBoundingBox
Coordinates for a rectangular area in which to search. See: insideBoundingBox
--optionalWords
Words that should be considered optional when found in the query. See: optionalWords
--reRankingApplyFilter
Restrict Dynamic Re-Ranking to records that match these filters.
Settings for the semantic search part of NeuralSearch.

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, jsonl, ndjson, jsonpath, jsonpath-as-json, jsonpath-file).
--template
Template string or path to a template file to use when —output=jsonpath, —output=jsonpath-file.

Pagination

--hitsPerPage
Number of hits per page. See: hitsPerPage
--length
Number of hits to retrieve (used in combination with offset). See: length
--offset
Position of the first hit to retrieve. See: offset
--page
Page of search results to retrieve. See: page

Personalization

--enablePersonalization
Whether to enable Personalization. See: enablePersonalization
--personalizationImpact
Impact that Personalization should have on this search. See: personalizationImpact
--userToken
Unique pseudonymous or anonymous user identifier. See: userToken

Query strategy

--advancedSyntax
Whether to support phrase matching and excluding words from search queries. See: advancedSyntax
--advancedSyntaxFeatures
Advanced search syntax features you want to support. See: advancedSyntaxFeatures
--alternativesAsExact
Determine which plurals and synonyms should be considered an exact matches. See: alternativesAsExact
--disableExactOnAttributes
Searchable attributes for which you want to turn off the Exact ranking criterion. See: disableExactOnAttributes
--exactOnSingleWordQuery
Determines how the Exact ranking criterion is computed when the search query has only one word. One of: attribute, none, word. See: exactOnSingleWordQuery
--mode
Search mode the index will use to query for results. One of: neuralSearch, keywordSearch. See: mode
--queryType
Determines if and how query words are interpreted as prefixes. One of: prefixLast, prefixAll, prefixNone. See: queryType
--removeWordsIfNoResults
Strategy for removing words from the query when it doesn’t return any results. One of: none, lastWords, firstWords, allOptional. See: removeWordsIfNoResults

Ranking

--ranking
Determines the order in which Algolia returns your results. See: ranking
--relevancyStrictness
Relevancy threshold below which less relevant results aren’t included in the results. See: relevancyStrictness

Rules

--enableRules
Whether to enable rules. See: enableRules
--ruleContexts
Assigns a rule context to the search query. See: ruleContexts
--query
Search query. See: query
--similarQuery
Keywords to be used instead of the search query to conduct a more broader search. See: similarQuery

Typos

--allowTyposOnNumericTokens
Whether to allow typos on numbers in the search query. See: allowTyposOnNumericTokens
--disableTypoToleranceOnAttributes
Attributes for which you want to turn off typo tolerance. See: disableTypoToleranceOnAttributes
--minWordSizefor1Typo
Minimum number of characters a word in the search query must contain to accept matches with one typo. See: minWordSizefor1Typo
--minWordSizefor2Typos
Minimum number of characters a word in the search query must contain to accept matches with two typos. See: minWordSizefor2Typos
--typoTolerance
Whether typo tolerance is enabled and how it is applied. See: typoTolerance
Last modified on May 20, 2026