Documents - Autocomplete Get
Autocompletes incomplete query terms based on input text and matching terms in the index.
GET {endpoint}/indexes('{indexName}')/docs/search.autocomplete?api-version=2026-04-01&search={search}&suggesterName={suggesterName}
GET {endpoint}/indexes('{indexName}')/docs/search.autocomplete?api-version=2026-04-01&search={search}&suggesterName={suggesterName}&autocompleteMode={autocompleteMode}&$filter={$filter}&fuzzy={fuzzy}&highlightPostTag={highlightPostTag}&highlightPreTag={highlightPreTag}&minimumCoverage={minimumCoverage}&searchFields={searchFields}&$top={$top}
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
endpoint
|
path | True |
string (uri) |
The endpoint URL of the search service. |
|
index
|
path | True |
string |
The name of the index. |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
|
search
|
query | True |
string |
The incomplete term which should be auto-completed. |
|
suggester
|
query | True |
string |
The name of the suggester as specified in the suggesters collection that's part of the index definition. |
|
$filter
|
query |
string |
An OData expression that filters the documents used to produce completed terms for the Autocomplete result. |
|
|
$top
|
query |
integer (int32) |
The number of auto-completed terms to retrieve. This must be a value between 1 and 100. The default is 5. |
|
|
autocomplete
|
query |
Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context while producing auto-completed terms. |
||
|
fuzzy
|
query |
boolean |
A value indicating whether to use fuzzy matching for the autocomplete query. Default is false. When set to true, the query will find terms even if there's a substituted or missing character in the search text. While this provides a better experience in some scenarios, it comes at a performance cost as fuzzy autocomplete queries are slower and consume more resources. |
|
|
highlight
|
query |
string |
A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting is disabled. |
|
|
highlight
|
query |
string |
A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting is disabled. |
|
|
minimum
|
query |
number (double) |
A number between 0 and 100 indicating the percentage of the index that must be covered by an autocomplete query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 80. |
|
|
search
|
query |
string[] |
The list of field names to consider when querying for auto-completed terms. Target fields must be included in the specified suggester. |
Request Header
| Name | Required | Type | Description |
|---|---|---|---|
| Accept |
The Accept header. |
||
| x-ms-client-request-id |
string (uuid) |
An opaque, globally-unique, client-generated string identifier for the request. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
The request has succeeded. |
|
| Other Status Codes |
An unexpected error response. |
Security
api-key
Type:
apiKey
In:
header
OAuth2Auth
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
Scopes
| Name | Description |
|---|---|
| https://search.azure.com/.default |
Examples
SearchIndexAutocompleteDocumentsGet
Sample request
GET https://myservice.search.windows.net/indexes('myindex')/docs/search.autocomplete?api-version=2026-04-01&search=washington medic&suggesterName=sg&autocompleteMode=oneTerm&fuzzy=False&highlightPostTag=</em>&highlightPreTag=<em>&minimumCoverage=80&searchFields=title,description
Sample response
[
{
"text": "medicaid",
"queryPlusText": "washington medicaid"
},
{
"text": "medicare",
"queryPlusText": "washington medicare"
},
{
"text": "medicine",
"queryPlusText": "washington medicine"
}
]
Definitions
| Name | Description |
|---|---|
| Accept |
The Accept header. |
|
Autocomplete |
The result of Autocomplete requests. |
|
Autocomplete |
Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context in producing autocomplete terms. |
|
Autocomplete |
The result of Autocomplete query. |
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). |
Accept
The Accept header.
| Value | Description |
|---|---|
| application/json;odata.metadata=none |
AutocompleteItem
The result of Autocomplete requests.
| Name | Type | Description |
|---|---|---|
| queryPlusText |
string |
The query along with the completed term. |
| text |
string |
The completed term. |
AutocompleteMode
Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context in producing autocomplete terms.
| Value | Description |
|---|---|
| oneTerm |
Only one term is suggested. If the query has two terms, only the last term is completed. For example, if the input is 'washington medic', the suggested terms could include 'medicaid', 'medicare', and 'medicine'. |
| twoTerms |
Matching two-term phrases in the index will be suggested. For example, if the input is 'medic', the suggested terms could include 'medicare coverage' and 'medical assistant'. |
| oneTermWithContext |
Completes the last term in a query with two or more terms, where the last two terms are a phrase that exists in the index. For example, if the input is 'washington medic', the suggested terms could include 'washington medicaid' and 'washington medical'. |
AutocompleteResult
The result of Autocomplete query.
| Name | Type | Description |
|---|---|---|
| @search.coverage |
number (double) |
A value indicating the percentage of the index that was considered by the autocomplete request, or null if minimumCoverage was not specified in the request. |
| value |
The list of returned Autocompleted items. |
ErrorAdditionalInfo
The resource management error additional info.
| Name | Type | Description |
|---|---|---|
| info |
|
The additional info. |
| type |
string |
The additional info type. |
ErrorDetail
The error detail.
| Name | Type | Description |
|---|---|---|
| additionalInfo |
The error additional info. |
|
| code |
string |
The error code. |
| details |
The error details. |
|
| message |
string |
The error message. |
| target |
string |
The error target. |
ErrorResponse
Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).
| Name | Type | Description |
|---|---|---|
| error |
The error object. |