diff --git a/src/Typesense/SearchResult.cs b/src/Typesense/SearchResult.cs index 362f93d..e1c1426 100644 --- a/src/Typesense/SearchResult.cs +++ b/src/Typesense/SearchResult.cs @@ -169,6 +169,9 @@ public abstract record SearchResultBase [JsonPropertyName("found")] public int Found { get; init; } + [JsonPropertyName("found_docs")] + public int? FoundDocs { get; init; } + [JsonPropertyName("out_of")] public int OutOf { get; init; } @@ -189,7 +192,8 @@ protected SearchResultBase( int outOf, int page, int searchTimeMs, - int? tookMs) + int? tookMs, + int? foundDocs = null) { FacetCounts = facetCounts; Found = found; @@ -197,6 +201,7 @@ protected SearchResultBase( Page = page; SearchTimeMs = searchTimeMs; TookMs = tookMs; + FoundDocs = foundDocs; } } diff --git a/test/Typesense.Tests/TypesenseClientTests.cs b/test/Typesense.Tests/TypesenseClientTests.cs index d6f1501..7dfd39a 100644 --- a/test/Typesense.Tests/TypesenseClientTests.cs +++ b/test/Typesense.Tests/TypesenseClientTests.cs @@ -1050,6 +1050,8 @@ public async Task Search_grouped_by_country() using (var scope = new AssertionScope()) { + response.Found.Should().Be(1); + response.FoundDocs.Value.Should().Be(1); response.GroupedHits.Should().NotBeEmpty(); var firstHit = response.GroupedHits.First(); firstHit.GroupKey.Should().BeEquivalentTo("USA");