SearchAsyncClient Class
- java.
lang. Object - com.
azure. search. documents. SearchAsyncClient
- com.
public final class SearchAsyncClient
Initializes a new instance of the asynchronous SearchClient type.
Method Summary
Methods inherited from java.lang.Object
Method Details
autocomplete
public Mono<AutocompleteResult> autocomplete(AutocompleteOptions options)
Autocompletes incomplete query terms based on input text and matching terms in the index.
Parameters:
Returns:
autocompleteWithResponse
public Mono<Response<AutocompleteResult>> autocompleteWithResponse(AutocompleteOptions options, RequestOptions requestOptions)
Autocompletes incomplete query terms based on input text and matching terms in the index.
Parameters:
Returns:
getDocument
public Mono<LookupDocument> getDocument(String key)
Retrieves a document from the index.
Parameters:
Returns:
getDocument
public Mono<LookupDocument> getDocument(String key, List<String> selectedFields)
Retrieves a document from the index.
Parameters:
Returns:
getDocumentCount
public Mono<Long> getDocumentCount()
Queries the number of documents in the index.
Returns:
getDocumentCountWithResponse
public Mono<Response<Long>> getDocumentCountWithResponse(RequestOptions requestOptions)
Queries the number of documents in the index.
Parameters:
Returns:
getDocumentWithResponse
public Mono<Response<LookupDocument>> getDocumentWithResponse(String key, RequestOptions requestOptions)
Retrieves a document from the index.
Query Parameters
| ------- | ------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name | Type | Required | Description |
| $select | List<String> | No | List of field names to retrieve for the document; Any field not retrieved will be missing from the returned document. In the form of "," separated string. |
You can add these to a request with RequestOptions#addQueryParam
Header Parameters
| ------------------------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Name | Type | Required | Description |
| x-ms-query-source-authorization | String | No | Token identifying the user for which the query is being executed. This token is used to enforce security restrictions on documents. |
| x-ms-enable-elevated-read | Boolean | No | A value that enables elevated read that bypass document level permission checks for the query operation. |
You can add these to a request with RequestOptions#addHeader
Parameters:
Returns:
getEndpoint
public String getEndpoint()
Gets the endpoint used to communicate with the Azure AI Search service.
Returns:
getIndexName
public String getIndexName()
Gets the name of the Azure AI Search index.
Returns:
getServiceVersion
public SearchServiceVersion getServiceVersion()
Gets the SearchServiceVersion used to communicate with the Azure AI Search service.
Returns:
indexDocuments
public Mono<IndexDocumentsResult> indexDocuments(IndexDocumentsBatch batch)
Sends a batch of document write actions to the index.
Parameters:
Returns:
indexDocumentsWithResponse
public Mono<Response<IndexDocumentsResult>> indexDocumentsWithResponse(IndexDocumentsBatch batch, IndexDocumentsOptions options, RequestOptions requestOptions)
Sends a batch of document write actions to the index.
Parameters:
Returns:
search
public SearchPagedFlux search(SearchOptions options)
Searches for documents in the Azure AI Search index.
The ContinuablePagedFlux will iterate through search result pages until all search results are returned. Each page is determined by the $skip and $top values and the Search service has a limit on the number of documents that can be skipped, more information about the $skip limit can be found at Search Documents REST API and reading the $skip description. If the total number of results exceeds the $skip limit the ContinuablePagedFlux won't prevent you from exceeding the $skip limit. To prevent exceeding the limit you can track the number of documents returned and stop requesting new pages when the limit is reached.
Parameters:
Returns:
search
public SearchPagedFlux search(SearchOptions options, RequestOptions requestOptions)
Searches for documents in the Azure AI Search index.
Header Parameters
| ------------------------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Name | Type | Required | Description |
| x-ms-query-source-authorization | String | No | Token identifying the user for which the query is being executed. This token is used to enforce security restrictions on documents. |
| x-ms-enable-elevated-read | Boolean | No | A value that enables elevated read that bypass document level permission checks for the query operation. |
You can add these to a request with RequestOptions#addHeader
The ContinuablePagedFlux will iterate through search result pages until all search results are returned. Each page is determined by the $skip and $top values and the Search service has a limit on the number of documents that can be skipped, more information about the $skip limit can be found at Search Documents REST API and reading the $skip description. If the total number of results exceeds the $skip limit the ContinuablePagedFlux won't prevent you from exceeding the $skip limit. To prevent exceeding the limit you can track the number of documents returned and stop requesting new pages when the limit is reached.
Parameters:
Returns:
suggest
public Mono<SuggestDocumentsResult> suggest(SuggestOptions options)
Suggests documents in the index that match the given partial query text.
Parameters:
Returns:
suggestWithResponse
public Mono<Response<SuggestDocumentsResult>> suggestWithResponse(SuggestOptions options, RequestOptions requestOptions)
Suggests documents in the index that match the given partial query text.
Parameters:
Returns: