forked from DAXGRID/typesense-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSearchResult.cs
35 lines (32 loc) · 1.01 KB
/
SearchResult.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace Typesense
{
public record Highlight
{
[JsonPropertyName("field")]
public string Field { get; init; }
[JsonPropertyName("snippet")]
public string Snippet { get; init; }
[JsonPropertyName("matched_tokens")]
public IReadOnlyList<string> MatchedTokens { get; init; }
}
public record Hit<T>
{
[JsonPropertyName("highlights")]
public IReadOnlyList<Highlight> Highlights { get; init; }
[JsonPropertyName("document")]
public T Document { get; init; }
}
public record SearchResult<T>
{
[JsonPropertyName("facet_counts")]
public IReadOnlyList<object> FacetCounts { get; init; }
[JsonPropertyName("found")]
public int Found { get; init; }
[JsonPropertyName("took_ms")]
public int TookMs { get; init; }
[JsonPropertyName("hits")]
public IReadOnlyList<Hit<T>> Hits { get; init; }
}
}