Example
Report incorrect code
Copy
using Algolia.Search.Clients;
using Algolia.Search.Http;
using Algolia.Search.Models.Search;
var client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY");
client.SearchSingleIndex<Hit>(
indexName: "ALGOLIA_INDEX_NAME",
searchParams: new SearchParams(new SearchParamsObject { Query = "SEARCH_QUERY" }),
options: new RequestOptions
{
// Add a custom HTTP header to this request
Headers = new Dictionary<string, string> { { "extra-header", "greetings " } },
// Add query parameters to this request
QueryParameters = new Dictionary<string, object> { { "queryParam", "value" } },
// Adjust timeout this request
ReadTimeout = TimeSpan.FromSeconds(10),
}
);
Reference
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
Additional headers to include in the request, as key–value pairs.
Additional query parameters to include in the request.
These apply only to API operations that support query parameters.
Otherwise, they’re ignored.
Maximum duration, in milliseconds, to wait for the server to respond to read requests
(retrieving data from Algolia).
Maximum duration, in milliseconds, to wait for the server to respond to write requests
(sending data to Algolia).
Maximum time to wait for the connection to be established, in milliseconds.
Additional headers to include in the request, as key–value pairs.
Additional query parameters to include in the request.
These apply only to API operations that support query parameters.
Otherwise, they’re ignored.
Maximum duration, in milliseconds, to wait for the server to respond to read requests
(retrieving data from Algolia).
Maximum duration, in milliseconds, to wait for the server to respond to write requests
(sending data to Algolia).
Maximum time to wait for the connection to be established, in milliseconds.
Additional headers to include in the request, as key–value pairs.
Use the
search.WithHeaderParam() function to add them.Additional query parameters to include in the request.
These apply only to API operations that support query parameters.
Otherwise, they’re ignored.
Use the
search.WithQueryParam() function to add them.Timeout durations for different types of network requests.
Hide child attributes
Hide child attributes
Maximum duration, in milliseconds, to wait for the server to respond to read requests
(retrieving data from Algolia).
Use the
search.WithReadTimeout() function to change this timeout.Maximum duration, in milliseconds, to wait for the server to respond to write requests
(sending data to Algolia).
Use the
search.WithWriteTimeout() function to change this timeout.Maximum time to wait for the connection to be established, in milliseconds.
Use the
search.WithConnectTimeout() function to change this timeout.Additional headers to include in the request, as key–value pairs.
Use the
RequestOptions.addExtraHeader() method to add them.Additional query parameters to include in the request.
These apply only to API operations that support query parameters.
Otherwise, they’re ignored.
Use the
RequestOptions.addExtraQueryParameters() method to add them.Maximum duration, in milliseconds, to wait for the server to respond to read requests
(retrieving data from Algolia).
Use the
RequestOptions.setReadTimeout() method to change this timeout.Maximum duration, in milliseconds, to wait for the server to respond to write requests
(sending data to Algolia).
Use the
RequestOptions.setWriteTimeout() method to change this timeout.Maximum time to wait for the connection to be established, in milliseconds.
Use the
RequestOptions.setConnectTimeout() method to change this timeout.Additional headers to include in the request, as key–value pairs.
Additional query parameters to include in the request.
These apply only to API operations that support query parameters.
Otherwise, they’re ignored.
Timeout durations for different types of network requests.
Hide child attributes
Hide child attributes
Maximum duration, in milliseconds, to wait for the server to respond to read requests
(retrieving data from Algolia).
Maximum duration, in milliseconds, to wait for the server to respond to write requests
(sending data to Algolia).
Maximum time to wait for the connection to be established, in milliseconds.
Additional headers to include in the request, as key–value pairs.
Additional query parameters to include in the request.
These apply only to API operations that support query parameters.
Otherwise, they’re ignored.
Maximum duration, in milliseconds, to wait for the server to respond to read requests
(retrieving data from Algolia).
Maximum duration, in milliseconds, to wait for the server to respond to write requests
(sending data to Algolia).
Maximum time to wait for the connection to be established, in milliseconds.
Additional headers to include in the request, as key–value pairs.
Additional query parameters to include in the request.
These apply only to API operations that support query parameters.
Otherwise, they’re ignored.
Maximum duration, in milliseconds, to wait for the server to respond to read requests
(retrieving data from Algolia).
Maximum duration, in milliseconds, to wait for the server to respond to write requests
(sending data to Algolia).
Maximum time to wait for the connection to be established, in milliseconds.
Additional headers to include in the request, as key–value pairs.
Additional query parameters to include in the request.
These apply only to API operations that support query parameters.
Otherwise, they’re ignored.
Timeout durations for different types of network requests.
Hide keys
Hide keys
Maximum duration, in milliseconds, to wait for the server to respond to read requests
(retrieving data from Algolia).
Maximum duration, in milliseconds, to wait for the server to respond to write requests
(sending data to Algolia).
Maximum time to wait for the connection to be established, in milliseconds.
Additional headers to include in the request, as key–value pairs.
Additional query parameters to include in the request.
These apply only to API operations that support query parameters.
Otherwise, they’re ignored.
Maximum duration, in milliseconds, to wait for the server to respond to requests.
Maximum time to wait for the connection to be established, in milliseconds.
Additional headers to include in the request, as key–value pairs.
Additional query parameters to include in the request.
These apply only to API operations that support query parameters.
Otherwise, they’re ignored.
Maximum duration, in milliseconds, to wait for the server to respond to read requests
(retrieving data from Algolia).
Maximum duration, in milliseconds, to wait for the server to respond to write requests
(sending data to Algolia).
Maximum time to wait for the connection to be established, in milliseconds.
Additional headers to include in the request, as key–value pairs.
Additional query parameters to include in the request.
These apply only to API operations that support query parameters.
Otherwise, they’re ignored.
Maximum duration, in milliseconds, to wait for the server to respond to read requests
(retrieving data from Algolia).
Maximum duration, in milliseconds, to wait for the server to respond to write requests
(sending data to Algolia).