API reference
- Overview
- Insights API
- Recommend API
- Search API
- Search operations
- Records operations
- Indices operations
- Synonyms operations
- API keys operations
- Rules operations
- Dictionaries operations
- Clusters operations
- Vaults operations
- Advanced operations
Search multiple indices
Sends multiple search request to one or more indices.
This can be useful in these cases:
- Different indices for different purposes, such as, one index for products, another one for marketing content.
- Multiple searches to the same index—for example, with different filters.
Your Algolia application ID.
Your Algolia API key with the necessary permissions to make the request. Permissions are controlled through access control lists (ACL) and access restrictions. The required ACL to make a request is listed in each endpoint's reference.
Strategy for multiple search queries:
none
. Run all queries.stopIfEnoughMatches
. Run the queries one by one, stopping as soon as a query matches at least thehitsPerPage
number of results.
Authorizations
Your Algolia application ID.
Your Algolia API key with the necessary permissions to make the request. Permissions are controlled through access control lists (ACL) and access restrictions. The required ACL to make a request is listed in each endpoint's reference.
Body
Search parameters as a URL-encoded query string.
Index name (case-sensitive).
default
: perform a search queryfacet
searches for facet values.
default
Strategy for multiple search queries:
none
. Run all queries.stopIfEnoughMatches
. Run the queries one by one, stopping as soon as a query matches at least thehitsPerPage
number of results.
none
, stopIfEnoughMatches
Response
A/B test ID. This is only included in the response for indices that are part of an A/B test.
Variant ID. This is only included in the response for indices that are part of an A/B test.
x > 1
Computed geographical location.
Distance from a central coordinate provided by aroundLatLng
.
Whether certain properties of the search response are calculated exhaustive (exact) or approximated.
Whether the facet count is exhaustive (true
) or approximate (false
). See the related discussion.
The value is false
if not all facet values are retrieved.
Whether the nbHits
is exhaustive (true
) or approximate (false
). When the query takes more than 50ms to be processed, the engine makes an approximation. This can happen when using complex filters on millions of records, when typo-tolerance was not exhaustive, or when enough hits have been retrieved (for example, after the engine finds 10,000 exact matches). nbHits
is reported as non-exhaustive whenever an approximation is made, even if the approximation didn’t, in the end, impact the exhaustivity of the query.
Rules matching exhaustivity. The value is false
if rules were enable for this query, and could not be fully processed due a timeout. This is generally caused by the number of alternatives (such as typos) which is too large.
Whether the typo search was exhaustive (true
) or approximate (false
). An approximation is done when the typo search query part takes more than 10% of the query budget (ie. 5ms by default) to be processed (this can happen when a lot of typo alternatives exist for the query). This field will not be included when typo-tolerance is entirely disabled.
See the facetsCount
field of the exhaustive
object in the response.
See the nbHits
field of the exhaustive
object in the response.
See the typo
field of the exhaustive
object in the response.
Statistics for numerical facets.
Index name used for the query.
Index name used for the query. During A/B testing, the targeted index isn't always the index used by the query.
Warnings about the query.
Number of hits selected and sorted by the relevant sort algorithm.
Post-normalization query string that will be searched.
Time the server took to process the request, in milliseconds.
Experimental. List of processing steps and their times, in milliseconds. You can use this list to investigate performance issues.
Markup text indicating which parts of the original query have been removed to retrieve a non-empty result set.
Redirect results to a URL, this this parameter is for internal use only.
Source index for the redirect rule.
Destination index for the redirect rule.
Reason for the redirect rule.
Redirect rule status.
Extra data that can be used in the search UI.
You can use this to control aspects of your search UI, such as, the order of facet names and values without changing your frontend code.
Order of facet names and facet values in your UI.
Order of facet names.
Explicit order of facets or facet values.
This setting lets you always show specific facets or facet values at the top of the list.
Time the server took to process the request, in milliseconds.
Host name of the server that processed the request.
An object with custom data.
You can store up to 32kB as custom data.
Unique identifier for the query. This is used for click analytics.
Page of search results to retrieve.
x > 0
Number of results (hits).
Number of pages of results.
Number of hits per page.
1 < x < 1000
Search results (hits).
Hits are records from your index that match the search criteria, augmented with additional attributes, such as, for highlighting.
Unique record identifier.
Surround words that match the query with HTML tags for highlighting.
Surround words that match the query with HTML tags for highlighting.
Highlighted attribute value, including HTML tags.
Whether the whole query string matches or only a part.
none
, partial
, full
List of matched words from the search query.
Whether the entire attribute value is highlighted.
Snippets that show the context around a matching search query.
Snippets that show the context around a matching search query.
Object with detailed information about the record's ranking.
Position of the first matched word in the best matching attribute of the record.
x > 0
Distance between the geo location in the search query and the best matching geo location in the record, divided by the geo precision (in meters).
x > 0
Number of exactly matched words.
x > 0
Number of typos encountered when matching the record.
x > 0
Overall ranking of the record, expressed as a single integer. This attribute is internal.
Whether a filter matched the query.
x > 0
Precision used when computing the geo distance, in meters.
x > 1
Latitude of the matched location.
Longitude of the matched location.
Distance between the matched location and the search location (in meters).
Whether the record was promoted by a rule.
Number of words between multiple matches in the query plus 1. For single word queries, proximityDistance
is 0.
x > 0
Number of matched words.
x > 1
Whether the record is re-ranked.
Search query.
URL-encoded string of all search parameters.
Was this page helpful?