curl --request POST \
--url 'https://algolia_application_id.algolia.net/1/indexes/*/queries' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-algolia-api-key: ALGOLIA_API_KEY' \
--header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \
--data '{"requests":[{"params":"hitsPerPage=2&getRankingInfo=1","indexName":"products","type":"default"}],"strategy":"none"}'{
"results": [
{
"hits": [
{
"objectID": "test-record-123",
"_highlightResult": {},
"_snippetResult": {},
"_rankingInfo": {
"firstMatchedWord": 1,
"geoDistance": 1,
"nbExactWords": 1,
"nbTypos": 1,
"userScore": 123,
"filters": 1,
"geoPrecision": 2,
"matchedGeoLocation": {
"lat": 123,
"lng": 123,
"distance": 123
},
"personalization": {
"filtersScore": 123,
"rankingScore": 123,
"score": 123
},
"promoted": true,
"proximityDistance": 1,
"words": 2,
"promotedByReRanking": true
},
"_distinctSeqID": 123
}
],
"query": "",
"params": "query=a&hitsPerPage=20",
"abTestID": 123,
"abTestVariantID": 2,
"aroundLatLng": "40.71,-74.01",
"automaticRadius": "<string>",
"exhaustive": {
"facetsCount": true,
"facetValues": true,
"nbHits": true,
"rulesMatch": true,
"typo": true
},
"appliedRules": [
{}
],
"exhaustiveFacetsCount": true,
"exhaustiveNbHits": true,
"exhaustiveTypo": true,
"facets": {
"category": {
"food": 1,
"tech": 42
}
},
"facets_stats": {},
"index": "indexName",
"indexUsed": "indexNameAlt",
"message": "<string>",
"nbSortedHits": 20,
"parsedQuery": "george clo",
"processingTimeMS": 20,
"processingTimingsMS": {},
"queryAfterRemoval": "<string>",
"redirect": {
"index": [
{
"source": "<string>",
"dest": "<string>",
"reason": "<string>",
"succeed": true,
"data": {
"ruleObjectID": "<string>"
}
}
]
},
"renderingContent": {
"facetOrdering": {
"facets": {
"order": [
"<string>"
]
},
"values": {}
},
"redirect": {
"url": "<string>"
},
"widgets": {
"banners": [
{
"image": {
"urls": [
{
"url": "<string>"
}
],
"title": "<string>"
},
"link": {
"url": "<string>"
}
}
]
}
},
"serverTimeMS": 20,
"serverUsed": "c2-uk-3.algolia.net",
"userData": {
"settingID": "f2a7b51e3503acc6a39b3784ffb84300",
"pluginVersion": "1.6.0"
},
"queryID": "a00dbc80a8d13c4565a442e7e2dca80a",
"_automaticInsights": true,
"page": 0,
"nbHits": 20,
"nbPages": 1,
"hitsPerPage": 20
}
]
}Sends multiple search requests to one or more indices.
This can be useful in these cases:
Use the helper searchForHits or searchForFacets to get the results in a more convenient format, if you already know the return type you want.
curl --request POST \
--url 'https://algolia_application_id.algolia.net/1/indexes/*/queries' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-algolia-api-key: ALGOLIA_API_KEY' \
--header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \
--data '{"requests":[{"params":"hitsPerPage=2&getRankingInfo=1","indexName":"products","type":"default"}],"strategy":"none"}'{
"results": [
{
"hits": [
{
"objectID": "test-record-123",
"_highlightResult": {},
"_snippetResult": {},
"_rankingInfo": {
"firstMatchedWord": 1,
"geoDistance": 1,
"nbExactWords": 1,
"nbTypos": 1,
"userScore": 123,
"filters": 1,
"geoPrecision": 2,
"matchedGeoLocation": {
"lat": 123,
"lng": 123,
"distance": 123
},
"personalization": {
"filtersScore": 123,
"rankingScore": 123,
"score": 123
},
"promoted": true,
"proximityDistance": 1,
"words": 2,
"promotedByReRanking": true
},
"_distinctSeqID": 123
}
],
"query": "",
"params": "query=a&hitsPerPage=20",
"abTestID": 123,
"abTestVariantID": 2,
"aroundLatLng": "40.71,-74.01",
"automaticRadius": "<string>",
"exhaustive": {
"facetsCount": true,
"facetValues": true,
"nbHits": true,
"rulesMatch": true,
"typo": true
},
"appliedRules": [
{}
],
"exhaustiveFacetsCount": true,
"exhaustiveNbHits": true,
"exhaustiveTypo": true,
"facets": {
"category": {
"food": 1,
"tech": 42
}
},
"facets_stats": {},
"index": "indexName",
"indexUsed": "indexNameAlt",
"message": "<string>",
"nbSortedHits": 20,
"parsedQuery": "george clo",
"processingTimeMS": 20,
"processingTimingsMS": {},
"queryAfterRemoval": "<string>",
"redirect": {
"index": [
{
"source": "<string>",
"dest": "<string>",
"reason": "<string>",
"succeed": true,
"data": {
"ruleObjectID": "<string>"
}
}
]
},
"renderingContent": {
"facetOrdering": {
"facets": {
"order": [
"<string>"
]
},
"values": {}
},
"redirect": {
"url": "<string>"
},
"widgets": {
"banners": [
{
"image": {
"urls": [
{
"url": "<string>"
}
],
"title": "<string>"
},
"link": {
"url": "<string>"
}
}
]
}
},
"serverTimeMS": 20,
"serverUsed": "c2-uk-3.algolia.net",
"userData": {
"settingID": "f2a7b51e3503acc6a39b3784ffb84300",
"pluginVersion": "1.6.0"
},
"queryID": "a00dbc80a8d13c4565a442e7e2dca80a",
"_automaticInsights": true,
"page": 0,
"nbHits": 20,
"nbPages": 1,
"hitsPerPage": 20
}
]
}searchYour 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.
Muli-search request body. Results are returned in the same order as the requests.
Search parameters as query string.
Show child attributes
Index name (case-sensitive).
"products"
Search parameters as a URL-encoded query string.
"hitsPerPage=2&getRankingInfo=1"
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 the hitsPerPage number of results.none, stopIfEnoughMatches OK
Show child attributes
Search results (hits).
Hits are records from your index that match the search criteria, augmented with additional attributes, such as, for highlighting.
Show child attributes
Unique record identifier.
"test-record-123"
Surround words that match the query with HTML tags for highlighting.
Show child attributes
Surround words that match the query with HTML tags for highlighting.
Show child attributes
Highlighted attribute value, including HTML tags.
"<em>George</em> <em>Clo</em>oney"
Whether the whole query string matches or only a part.
none, partial, full List of matched words from the search query.
["action"]Whether the entire attribute value is highlighted.
Snippets that show the context around a matching search query.
Show child attributes
Snippets that show the context around a matching search query.
Show child attributes
Highlighted attribute value, including HTML tags.
"<em>George</em> <em>Clo</em>oney"
Whether the whole query string matches or only a part.
none, partial, full Object with detailed information about the record's ranking.
Show child attributes
Position of the first matched word in the best matching attribute of the record.
x >= 0Distance 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 >= 0Number of exactly matched words.
x >= 0Number of typos encountered when matching the record.
x >= 0Overall ranking of the record, expressed as a single integer. This attribute is internal.
Whether a filter matched the query.
x >= 0Precision used when computing the geo distance, in meters.
x >= 1Show child attributes
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 >= 0Number of matched words.
x >= 1Whether the record is re-ranked.
Search query.
URL-encoded string of all search parameters.
"query=a&hitsPerPage=20"
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 >= 1Computed geographical location.
"40.71,-74.01"
Distance from a central coordinate provided by aroundLatLng.
Whether certain properties of the search response are calculated exhaustive (exact) or approximated.
Show child attributes
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.
Rules applied to the query.
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.
Show child attributes
Show child attributes
Minimum value in the results.
Maximum value in the results.
Average facet value in the results.
Sum of all values in the results.
Index name used for the query.
"indexName"
Index name used for the query. During A/B testing, the targeted index isn't always the index used by the query.
"indexNameAlt"
Warnings about the query.
Number of hits selected and sorted by the relevant sort algorithm.
20
Post-normalization query string that will be searched.
"george clo"
Time the server took to process the request, in milliseconds.
20
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.
Show child attributes
Show child attributes
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.
Show child attributes
Order of facet names and facet values in your UI.
Show child attributes
Order of facet values. One object for each facet.
Show child attributes
Show child attributes
Explicit order of facets or facet values.
This setting lets you always show specific facets or facet values at the top of the list.
Order of facet values that aren't explicitly positioned with the order setting.
count.
Order remaining facet values by decreasing count.
The count is the number of matching records containing this facet value.
alpha.
Sort facet values alphabetically.
hidden.
Don't show facet values that aren't explicitly positioned.
count, alpha, hidden Hide facet values.
Widgets returned from any rules that are applied to the current search.
Show child attributes
Banners defined in the Merchandising Studio for a given search.
Show child attributes
Time the server took to process the request, in milliseconds.
20
Host name of the server that processed the request.
"c2-uk-3.algolia.net"
An object with custom data.
You can store up to 32kB as custom data.
{
"settingID": "f2a7b51e3503acc6a39b3784ffb84300",
"pluginVersion": "1.6.0"
}Unique identifier for the query. This is used for click analytics.
"a00dbc80a8d13c4565a442e7e2dca80a"
Whether automatic events collection is enabled for the application.
Page of search results to retrieve.
x >= 0Number of results (hits).
20
Number of pages of results.
1
Number of hits per page.
1 <= x <= 1000Was this page helpful?