Algolia CLI / Commands

Manage your indices’ objects.

algolia objects browse

Usage
algolia objects browse <index> [flags]

Browse the index objects.

Examples

1
2
3
4
5
6
7
8
9
10
11
12
# Browse the objects from the "BOOKS" index
$ algolia objects browse BOOKS

# Browse the objects from the "BOOKS" index and select which attributes to retrieve
$ algolia objects browse BOOKS --attributesToRetrieve author,title,description

# Browse the objects from the "BOOKS" index with filters
$ algolia objects browse BOOKS --filters "'(category:Book OR category:Ebook) AND _tags:published'"

# Browse the objects from the "BOOKS" and export the results to a new line delimited JSON (ndjson) file
$ algolia objects browse BOOKS > books.ndjson

Advanced

--attributeCriteriaComputedByMinProximity

When attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage.

--distinct

Enables de-duplication or grouping of results.

--enableABTest

Whether this search should participate in running AB tests.

--enableReRanking

Whether this search should use AI Re-Ranking.

--getRankingInfo

Retrieve detailed ranking information.

--maxFacetHits

Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100.

--minProximity

Precision of the proximity ranking criterion.

--percentileComputation

Whether to include or exclude a query from the processing-time percentile computation.

--renderingContent

Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules.

--responseFields

Choose which fields to return in the API response. This parameters applies to search and browse queries.

--synonyms

Whether to take into account an index’s synonyms for a particular search.

Analytics

--analytics

Whether the current query will be taken into account in the Analytics.

--analyticsTags

List of tags to apply to the query for analytics purposes.

--clickAnalytics

Enable the Click Analytics feature.

Attributes

--attributesToRetrieve

This parameter controls which attributes to retrieve and which not to retrieve.

--restrictSearchableAttributes

Restricts a given query to look in only a subset of your searchable attributes.

Faceting

--attributesForFaceting

The complete list of attributes that will be used for faceting.

--facetingAfterDistinct

Force faceting to be applied after de-duplication (via the Distinct setting).

--facets

Retrieve facets and their facet values.

--maxValuesPerFacet

Maximum number of facet values to return for each facet during a regular search.

--sortFacetValuesBy

Controls how facet values are fetched.

Filtering

--facetFilters

Filter hits by facet value.

--filters

Filter the query with numeric, facet and/or tag filters.

--numericFilters

Filter on numeric attributes.

--optionalFilters

Create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter.

--reRankingApplyFilter

When Dynamic Re-Ranking is enabled, only records that match these filters will be impacted by Dynamic Re-Ranking.

--sumOrFiltersScores

Determines how to calculate the total score for filtering.

--tagFilters

Filter hits by tags.

--aroundLatLng

Search for entries around a central geolocation, enabling a geo search within a circular area.

--aroundLatLngViaIP

Search for entries around a given location automatically computed from the requester’s IP address.

--aroundPrecision

Precision of geo search (in meters), to add grouping by geo location to the ranking formula.

--aroundRadius

Define the maximum radius for a geo search (in meters).

--insideBoundingBox

Search inside a rectangular area (in geo coordinates).

--insidePolygon

Search inside a polygon (in geo coordinates).

--minimumAroundRadius

Minimum radius (in meters) used for a geo search when aroundRadius is not set.

Highlighting and Snippeting

--attributesToHighlight

List of attributes to highlight.

--attributesToSnippet

List of attributes to snippet, with an optional maximum number of words to snippet.

--highlightPostTag

The HTML string to insert after the highlighted parts in all highlight and snippet results.

--highlightPreTag

The HTML string to insert before the highlighted parts in all highlight and snippet results.

--replaceSynonymsInHighlight

Whether to highlight and snippet the original word that matches the synonym or the synonym itself.

--restrictHighlightAndSnippetArrays

Restrict highlighting and snippeting to items that matched the query.

--snippetEllipsisText

String used as an ellipsis indicator when a snippet is truncated.

Languages

--decompoundQuery

Splits compound words into their composing atoms in the query.

--ignorePlurals

Treats singular, plurals, and other forms of declensions as matching terms.
ignorePlurals is used in conjunction with the queryLanguages setting.
list: language ISO codes for which ignoring plurals should be enabled. This list will override any values that you may have set in queryLanguages. true: enables the ignore plurals functionality, where singulars and plurals are considered equivalent (foot = feet). The languages supported here are either every language (this is the default, see list of languages below), or those set by queryLanguages. false: disables ignore plurals, where singulars and plurals are not considered the same for matching purposes (foot will not find feet).
.

--keepDiacriticsOnCharacters

List of characters that the engine shouldn’t automatically normalize.

--naturalLanguages

This parameter changes the default values of certain parameters and settings that work best for a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts. These parameters and settings work well together when the query is formatted in natural language instead of keywords, for example when your user performs a voice search.

--queryLanguages

Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection.

--removeStopWords

Removes stop (common) words from the query before executing it.
removeStopWords is used in conjunction with the queryLanguages setting.
list: language ISO codes for which ignoring plurals should be enabled. This list will override any values that you may have set in queryLanguages. true: enables the stop word functionality, ensuring that stop words are removed from consideration in a search. The languages supported here are either every language, or those set by queryLanguages. false: disables stop word functionality, allowing stop words to be taken into account in a search.
.

Other flags

--attributeForDistinct

Name of the de-duplication attribute to be used with the distinct feature.

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

Set the number of hits per page.

--length

Set the number of hits to retrieve (used only with offset).

--offset

Specify the offset of the first hit to return.

--page

Specify the page to retrieve.

Personalization

--enablePersonalization

Enable the Personalization feature.

--personalizationImpact

Define the impact of the Personalization feature.

--userToken

Associates a certain user token with the current search.

Query strategy

--advancedSyntax

Enables the advanced query syntax.

--advancedSyntaxFeatures

Allows you to specify which advanced syntax features are active when ‘advancedSyntax’ is enabled.

--alternativesAsExact

List of alternatives that should be considered an exact match by the exact ranking criterion.

--disableExactOnAttributes

List of attributes on which you want to disable the exact ranking criterion.

--exactOnSingleWordQuery

Controls how the exact ranking criterion is computed when the query contains only one word. One of: (attribute, none, word).

--optionalWords

A list of words that should be considered as optional when found in the query.

--queryType

Controls if and how query words are interpreted as prefixes. One of: (prefixLast, prefixAll, prefixNone).

--removeWordsIfNoResults

Selects a strategy to remove words from the query when it doesn’t match any hits. One of: (none, lastWords, firstWords, allOptional).

Ranking

--customRanking

Specifies the custom ranking criterion.

--ranking

Controls how Algolia should sort your results.

--relevancyStrictness

Controls the relevancy threshold below which less relevant results aren’t included in the results.

Rules

--enableRules

Whether Rules should be globally enabled.

--ruleContexts

Enables contextual rules.

--query

The text to search in the index.

--similarQuery

Overrides the query parameter and performs a more generic search that can be used to find “similar” results.

Typos

--allowTyposOnNumericTokens

Whether to allow typos on numbers (“numeric tokens”) in the query string.

--disableTypoToleranceOnAttributes

List of attributes on which you want to disable typo tolerance.

--minWordSizefor1Typo

Minimum number of characters a word in the query string must contain to accept matches with 1 typo.

--minWordSizefor2Typos

Minimum number of characters a word in the query string must contain to accept matches with 2 typos.

--typoTolerance

Controls whether typo tolerance is enabled and how it is applied.

algolia objects delete

Usage
algolia objects delete <index> --object-ids <object-ids> --confirm [flags]

Delete objects from an index.

Examples

1
2
3
4
5
6
# Delete one single object with the ID "1" from the "TEST_PRODUCTS_1" index
$ algolia objects delete TEST_PRODUCTS_1 --object-ids 1

# Delete multiple objects with the IDs "1" and "2" from the "TEST_PRODUCTS_1" index
$ algolia objects delete TEST_PRODUCTS_1 --object-ids 1,2

Flags

-y, --confirm

skip confirmation prompt.

--object-ids

Object IDs to delete.

algolia objects import

Usage
algolia objects import <index> -F <file> [flags]

Import objects to the specified index.

Examples

1
2
3
4
5
6
7
8
9
# Import objects from the "data.ndjson" file to the "TEST_PRODUCTS_1" index
$ algolia objects import TEST_PRODUCTS_1 -F data.ndjson

# Import objects from the standard input to the "TEST_PRODUCTS_1" index
$ cat data.ndjson | algolia objects import TEST_PRODUCTS_1 -F -

# Browse the objects in the "TEST_PRODUCTS_1" index and import them to the "TEST_PRODUCTS_2" index
$ algolia objects browse TEST_PRODUCTS_1 | algolia objects import TEST_PRODUCTS_2 -F -

Flags

--auto-generate-object-id-if-not-exist

Automatically generate object ID if not exist.

-b, --batch-size

Specify the upload batch size.

-F, --file

Read records to import from file (use “-“ to read from standard input).

Did you find this page helpful?