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

Advanced

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

Analytics

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

Attributes

--attributesToRetrieve
Attributes to include in the API response.

Faceting

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

Filtering

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

Highlighting and Snippeting

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

Languages

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

Other flags

--insideBoundingBox
--optionalWords
Words that should be considered optional when found in the query.
--reRankingApplyFilter
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, 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.
--length
Number of hits to retrieve (used in combination with offset).
--offset
Position of the first hit to retrieve.
--page
Page of search results to retrieve.

Personalization

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

Query strategy

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

Ranking

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

Rules

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

Typos

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