1
0
mirror of https://github.com/redis/go-redis.git synced 2025-09-04 09:22:10 +03:00

fix(search): return results even if doc is empty (#3457)

* fix(search): return results even if doc is empty

"If a relevant key expires while a query is running, an attempt to load
the key's value will return a null array. However, the key is still
counted in the total number of results." - Redis Search return
documentation

* fix(doctest): fix assertions in doctests
This commit is contained in:
Nedyalko Dyakov
2025-07-31 15:21:05 +03:00
committed by GitHub
parent 5aca9c28ac
commit 9cfefa6896
4 changed files with 14 additions and 7 deletions

View File

@@ -219,7 +219,7 @@ func ExampleClient_search_json() {
// STEP_END
// Output:
// {1 [{user:3 <nil> <nil> <nil> map[$:{"age":35,"city":"Tel Aviv","email":"paul.zamir@example.com","name":"Paul Zamir"}]}]}
// {1 [{user:3 <nil> <nil> <nil> map[$:{"age":35,"city":"Tel Aviv","email":"paul.zamir@example.com","name":"Paul Zamir"}] <nil>}]}
// London
// Tel Aviv
// 0
@@ -329,5 +329,5 @@ func ExampleClient_search_hash() {
// STEP_END
// Output:
// {1 [{huser:3 <nil> <nil> <nil> map[age:35 city:Tel Aviv email:paul.zamir@example.com name:Paul Zamir]}]}
// {1 [{huser:3 <nil> <nil> <nil> map[age:35 city:Tel Aviv email:paul.zamir@example.com name:Paul Zamir] <nil>}]}
}