HawksearchClient
Goal
This article contains information about the functionalities and construction of the HawksearchClient class.
Â
Functionalities
The HawksearchClient class exposes an API for searching and indexing for example methods related to the creation of an index, adding document to it and executing search request.
You can find more information regarding the searching and indexing functionalities in the following sections Indexing operations ,Searching operations
Â
Prerequisite
Installed .NET SDK NuGet package
Â
Construction
The HawksearchClient has two constructor overloads.
The first one haw the following signature:
HawksearchClient(string baseFieldUrl, string baseIndexingUrl, string baseSearchUrl, string autocompleteUrl, string clientId, string apiKey, double documentSizeLimitInMB = 4, double batchSizeLimitInMB = 4, int maxBatchCapacity = 125)
Â
Parameters:
string baseFieldUrl
- mandatory
This is the Hawksearch Base API URL.
string baseIndexingUrl
- mandatory
This is the Hawksearch Indexing API URL.
string baseSearchUrl
- mandatory
This is the Hawksearch Searching API URL.
string autocompleteUrl
- mandatory
This is the Hawksearch Searching API autocomplete endpoint URL.
string clientId
- mandatory
This is the unique client ID.
string apiKey
- mandatory
This is the unique API key.
double documentSizeLimitInMB
- optional
This parameter controls the maximum size of the documents that can be indexed. The default value is 4 MB.
double batchSizeLimitInMB
- optional
This parameter controls the maximum size of the batches of documents which are sent for indexing. The default value is 4MB.
int maxBatchCapacity
- optional
This parameter controls the maximum number of documents that a batch can contain. The default value is 125.
The second one has the following signature:
HawksearchClient(string baseFieldUrl, string baseIndexingUrl, string baseSearchUrl, string autocompleteUrl, string clientId, string apiKey, bool enableIndexTraceLog, bool enableSearchTraceLog, Action<HttpRequestMessage> requestLog, Action<HttpResponseMessage> responseLog, double documentSizeLimitInMB = 4, double batchSizeLimitInMB = 4, int maxBatchCapacity = 125)
Â
Parameters:
string baseFieldUrl
- mandatory
This is the Hawksearch Base API URL.
string baseIndexingUrl
- mandatory
This is the Hawksearch Indexing API URL.
string baseSearchUrl
- mandatory
This is the Hawksearch Searching API URL.
string autocompleteUrl
- mandatory
This is the Hawksearch Searching API autocomplete endpoint URL.
string clientId
- mandatory
This is the unique client ID.
string apiKey
- mandatory
This is the unique API key.
bool enableIndexTraceLog
- mandatory
Controls whether index trace logging should be active.
bool enableSearchTraceLog
- mandatory
Controls whether search trace logging should be active.
Action<HttpRequestMessage> requestLog
- mandatory
A delegate which controls how request logs are made.
Action<HttpResponseMessage> responseLog
- mandatory
A delegate which controls how response logs are made.
double documentSizeLimitInMB
- optional
This parameter controls the maximum size of the documents that can be indexed. The default value is 4 MB.
double batchSizeLimitInMB
- optional
This parameter controls the maximum size of the batches of documents which are sent for indexing. The default value is 4MB.
int maxBatchCapacity
- optional
This parameter controls the maximum number of documents that a batch can contain. The default value is 125.