I am looking for implementing spell checker for the azure cognitive search in C#. For now I have reviewed the spell checker link from the official Microsoft documentation:
https://learn.microsoft.com/en-us/azure/search/speller-how-to-add
But there's no code snippet or example that demonstrates the use in C#. The link does say we need to pass the parameters like "speller=lexicon" and "queryLanguage=en-us" with the search API call.
I have a basic search implemented for Azure Cognitive search. Please refer the below code snippet:
// Configures the 'SearchParameters' object
SearchParameters searchParams = new SearchParameters
{
Skip = (page - 1) * PAGE_SIZE,
Top = PAGE_SIZE,
IncludeTotalResultCount = true,
Facets = Facets
};
// Returns all results on initial page load
string searchString = "*";
if (!string.IsNullOrEmpty(searchText))
searchString = searchText;
// Performs a search request on the specified Azure Search index with the configured 'SearchParameters' object
DocumentSearchResult<Document> result = searchIndexClient.Documents.Search(searchString, searchParams);
But the "SearchParameters" have no properties of passing the "speller" and "queryLanguage" parameters to get the result for spell checker. Please review the screenshot below:
Can anyone suggest for the "spell checker" for code implementation in C#?