Search API (0.1.0)
Download OpenAPI specification:Download
API powering the Search feature of Algolia.
Send requests to the Algolia REST API.
This method allow you to send requests to the Algolia REST API.
path Parameters
path required | string Example: /keys The path of the API endpoint to target, anything after the /1 needs to be specified. |
query Parameters
object Query parameters to be applied to the current query. |
Request Body schema: application/json
The parameters to send with the custom request.
Responses
Request samples
- Payload
{ }
Response samples
- 200
- 400
- 402
- 403
- 404
{ }
Get search results.
Get search results.
path Parameters
indexName required | string Example: myIndexName The index in which to perform the request. |
Request Body schema: application/json
params | string (paramsAsString) Default: "" Search parameters as URL-encoded query string. |
Responses
Request samples
- Payload
{- "params": ""
}
Response samples
- 200
- 400
- 402
- 403
- 404
{- "abTestID": 0,
- "abTestVariantID": 0,
- "aroundLatLng": "string",
- "automaticRadius": "string",
- "exhaustiveFacetsCount": true,
- "exhaustiveNbHits": true,
- "exhaustiveTypo": true,
- "facets": {
- "category": {
- "food": 1,
- "tech": 42
}
}, - "facets_stats": {
- "property1": {
- "min": 0,
- "max": 0,
- "avg": 0,
- "sum": 0
}, - "property2": {
- "min": 0,
- "max": 0,
- "avg": 0,
- "sum": 0
}
}, - "hitsPerPage": 20,
- "index": "indexName",
- "indexUsed": "indexNameAlt",
- "message": "string",
- "nbHits": 20,
- "nbPages": 1,
- "nbSortedHits": 20,
- "page": 0,
- "params": "query=a&hitsPerPage=20",
- "parsedQuery": "string",
- "processingTimeMS": 20,
- "query": "",
- "queryAfterRemoval": "string",
- "serverUsed": "string",
- "userData": { },
- "hits": [
- {
- "objectID": "string",
- "_highlightResult": {
- "value": "<em>George</em> <em>Clo</em>oney",
- "matchLevel": "none",
- "matchedWords": [
- "string"
], - "fullyHighlighted": true
}, - "_snippetResult": {
- "value": "<em>George</em> <em>Clo</em>oney",
- "matchLevel": "none"
}, - "_rankingInfo": {
- "filters": 0,
- "firstMatchedWord": 0,
- "geoDistance": 0,
- "geoPrecision": 0,
- "matchedGeoLocation": {
- "lat": 0,
- "lng": 0,
- "distance": 0
}, - "personalization": {
- "filtersScore": 0,
- "rankingScore": 0,
- "score": 0
}, - "nbExactWords": 0,
- "nbTypos": 0,
- "promoted": true,
- "proximityDistance": 0,
- "userScore": 0,
- "words": 0,
- "promotedByReRanking": true
}, - "_distinctSeqID": 0
}
]
}
Get search results for the given requests.
Get search results for the given requests.
Request Body schema: application/json
The multipleQueries
requests and strategy.
required | Array of objects (multipleQueries) [ items ] |
strategy | string (multipleQueriesStrategy) Enum: "none" "stopIfEnoughMatches" |
Responses
Request samples
- Payload
{- "requests": [
- {
- "indexName": "products",
- "query": "",
- "type": "default",
- "facet": "string",
- "params": "string"
}
], - "strategy": "none"
}
Response samples
- 200
- 400
- 402
- 403
- 404
{- "results": [
- {
- "abTestID": 0,
- "abTestVariantID": 0,
- "aroundLatLng": "string",
- "automaticRadius": "string",
- "exhaustiveFacetsCount": true,
- "exhaustiveNbHits": true,
- "exhaustiveTypo": true,
- "facets": {
- "category": {
- "food": 1,
- "tech": 42
}
}, - "facets_stats": {
- "property1": {
- "min": 0,
- "max": 0,
- "avg": 0,
- "sum": 0
}, - "property2": {
- "min": 0,
- "max": 0,
- "avg": 0,
- "sum": 0
}
}, - "hitsPerPage": 20,
- "index": "indexName",
- "indexUsed": "indexNameAlt",
- "message": "string",
- "nbHits": 20,
- "nbPages": 1,
- "nbSortedHits": 20,
- "page": 0,
- "params": "query=a&hitsPerPage=20",
- "parsedQuery": "string",
- "processingTimeMS": 20,
- "query": "",
- "queryAfterRemoval": "string",
- "serverUsed": "string",
- "userData": { },
- "hits": [
- {
- "objectID": "string",
- "_highlightResult": {
- "value": "<em>George</em> <em>Clo</em>oney",
- "matchLevel": "none",
- "matchedWords": [
- "string"
], - "fullyHighlighted": true
}, - "_snippetResult": {
- "value": "<em>George</em> <em>Clo</em>oney",
- "matchLevel": "none"
}, - "_rankingInfo": {
- "filters": 0,
- "firstMatchedWord": 0,
- "geoDistance": 0,
- "geoPrecision": 0,
- "matchedGeoLocation": {
- "lat": 0,
- "lng": 0,
- "distance": 0
}, - "personalization": {
- "filtersScore": 0,
- "rankingScore": 0,
- "score": 0
}, - "nbExactWords": 0,
- "nbTypos": 0,
- "promoted": true,
- "proximityDistance": 0,
- "userScore": 0,
- "words": 0,
- "promotedByReRanking": true
}, - "_distinctSeqID": 0
}
]
}
]
}
Search for values of a given facet
Search for values of a given facet, optionally restricting the returned values to those contained in objects matching other search criteria.
path Parameters
indexName required | string Example: myIndexName The index in which to perform the request. |
facetName required | string The facet name. |
Request Body schema: application/json
params | string (paramsAsString) Default: "" Search parameters as URL-encoded query string. |
facetQuery | string Default: "" Text to search inside the facet's values. |
maxFacetHits | integer (maxFacetHits) <= 100 Default: 10 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. |
Responses
Request samples
- Payload
{- "params": "",
- "facetQuery": "",
- "maxFacetHits": 10
}
Response samples
- 200
- 400
- 402
- 403
- 404
{- "facetHits": [
- {
- "value": "string",
- "highlighted": "<em>George</em> <em>Clo</em>oney",
- "count": 0
}
]
}