02 Jul 2018

Search API parameters

Search “search parameters”

Search Parameters

Here is the list of parameters you can use with the search method (search scope): Parameters that can also be used in a setSettings also have the indexing scope

query
search

The text to search in the index.

Attributes

attributesToRetrieve
settings search

List of attributes you want to retrieve.

restrictSearchableAttributes
search

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

This setting overrides searchableAttributes for specific searches.

Filtering

filters
search

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

facetFilters
search

Filter hits by facet value.

optionalFilters
search

Create filters for ranking purposes, where records that match the filter are ranked highest.

numericFilters
search

Filter on numeric attributes.

tagFilters
search

Filter hits by tags.

sumOrFiltersScores
search

Determines how to calculate the total score for filtering.

Faceting

facets
search

Facets to retrieve.

maxValuesPerFacet
settings search

Maximum number of facet values returned for each facet.

facetingAfterDistinct
search

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

sortFacetValuesBy
settings search

Controls how facet values are sorted.

Highlighting / Snippeting

attributesToHighlight
settings search

List of attributes to highlight.

attributesToSnippet
settings search

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

highlightPreTag
settings search

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

highlightPostTag
settings search

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

snippetEllipsisText
settings search

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

restrictHighlightAndSnippetArrays
settings search

Restrict highlighting and snippeting to items that matched the query.

Pagination

page
search

Specify the page to retrieve.

hitsPerPage
settings search

Set the number of hits per page.

In most cases, page/hitsPerPage is the recommended method for pagination. Check our full discussion on pagination approaches.

offset
search

Specify the offset of the first hit to return.

In most cases, page/hitsPerPage is the recommended method for pagination. This setting is part of an alternative paging approach.

length
search

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

In most cases, page/hitsPerPage is the recommended method for pagination. This setting is part of an alternative paging approach.

Typos

minWordSizefor1Typo
settings search

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

minWordSizefor2Typos
settings search

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

typoTolerance
settings search

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

allowTyposOnNumericTokens
settings search

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

ignorePlurals
settings search

Treat singular, plurals, and declensions as matching terms with no typo.

disableTypoToleranceOnAttributes
settings search

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

aroundLatLng
search

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

aroundLatLngViaIP
search

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

aroundRadius
search

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

aroundPrecision
search

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

minimumAroundRadius
search

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

insideBoundingBox
search

Search inside a rectangular area (in geo coordinates).

insidePolygon
search

Search inside a polygon (in geo coordinates).

Query Strategy

queryType
search settings

Controls if and how query words are interpreted as prefixes.

removeWordsIfNoResults
settings search

Selects a strategy to remove words from the query when it doesn’t match any hits.

advancedSyntax
settings search

Enables the advanced query syntax.

optionalWords
settings search

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

removeStopWords
settings search

Remove stop (common) words from the query before executing it.

disableExactOnAttributes
settings search

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

exactOnSingleWordQuery
settings search

Controls how the exact ranking criterion is computed when the query contains only one word.

alternativesAsExact
setting search

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

Query Rules

enableRules
search settings

Whether rules should be globally enabled.

ruleContexts
search

Enables contextual rules.

Advanced

distinct
settings search

Enables de-duplication or grouping of results.

getRankingInfo
search

Retrieve detailed ranking information.

clickAnalytics
search

Enable the Click Analytics feature.

analytics
search

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

analyticsTags
search

List of tags to apply to the query in the analytics.

synonyms
search

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

replaceSynonymsInHighlight
settings search

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

minProximity
settings search

Precision of the proximity ranking criterion.

responseFields
settings search

Choose which fields the response will contain. Applies to search and browse queries.

maxFacetHits
settings search

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

percentileComputation
search

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

© Algolia - Privacy Policy