We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I spent hours to find documentation or a sample how to use highlighting. Eventually I figured it out myself and created the following base class:
public abstract record IndexedSearchItem { [JsonProperty(PropertyName ="_snippetResult")] public Dictionary<string, SnippetResult>? SnippetResult { get; set; } [JsonProperty(PropertyName = "_highlightResult")] public Dictionary<string, HighlightResult>? HighlightResult { get; set; } public string RenderProperty(string property) { if (SnippetResult?.TryGetValue(property, out var snippetResult) == true) { return snippetResult.Value; } if (HighlightResult?.TryGetValue(property, out var highlightResult) == true) { return highlightResult.Value; } var clrProperty = GetType().GetProperties().FirstOrDefault(x => string.Equals(x.Name, property, StringComparison.OrdinalIgnoreCase)); if (clrProperty?.CanRead == true) { return clrProperty.GetValue(this)?.ToString() ?? string.Empty; } return string.Empty; } public bool ShouldSerializeSnippetResult() { return false; } public bool ShouldSerializeHighlightResult() { return false; } }
Would be great to have documentation about this...
The text was updated successfully, but these errors were encountered:
Hello,
We will release in few days a new major version of all Algolia C# Clients. In this version, Highlight and Snippet are directly available.
Highlight
Snippet
I'll reply in this thread as soon as the client is released.
Sorry, something went wrong.
The Alpha version is now released on Nuget.
If you have time, we need customer feedback about this new version. It's still not GA so you may not want to use it in production.
There is no more deps on Newtonsoft, all Algolia APIs are now available (Insights, Recommend, Query Perso, ...) and all models and routes are synced.
To help you migrate, there is a Migration guide.
Happy to help in your migration process !
No branches or pull requests
I spent hours to find documentation or a sample how to use highlighting. Eventually I figured it out myself and created the following base class:
Would be great to have documentation about this...
The text was updated successfully, but these errors were encountered: