Searching operations
Goal
This article contains information about the implementation of the searching process. The C# SDK exposes a method which can be used to make search requests to the Hawksearch API. All of these methods can be found in the HawksearchClient class.
Prerequisite
Installed .NET SDK NuGet package
Â
Search
The Search method exposes a functionality to make search requests to the Hawksearch API.
SearchResult Search(SearchQuery query);
Parameters
SearchQuery query
The SearchQuery
object should contain all the information needed to make the request to the Hawksearch API. The mandatory ones are ClientGuid
,IndexName
,Keyword
and FacetSelections
.
Returns
SearchResult
The Hawksearch API responds with a message which is the mapped to an object of type SearchResult
The search results are deserialized and mapped to a List<Result> Results
Usage
Call this method when you want to make search requests to the Hawksearch API.
Â
Autocomplete
The Autocomplete method exposes a functionality for autocompleting search request depending on input.
Parameters
AutocompleteQuery query
This is the data which is expected in order to make a successful autocomplete request
The mandatory ones are ClientGuid
, Keyword
, IndexName
, DisplayFullResponse
.
Returns
AutocompleteResult
The Hawksearch API returns a response message which is mapped to object of type AutocompleteResult
The actual autocomplete results are mapped to a List<Product> Products
And the data for each result is mapped to an object of type Result
Usage
Call this method when you want to enhance your UI by using the results from the Autocomplete method to display suggestions to your users.