Skip to content

Commit 2bb515e

Browse files
authored
fix(search): align ft.search with server (#2988)
as per the ft.search docs ( https://redis.io/docs/latest/commands/ft.search ): 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. So, instead of crashing when seeing a null as a value, we return empty object. fixes #2772 see #2814
1 parent b33a662 commit 2bb515e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/search/lib/commands/SEARCH.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ export interface SearchReply {
221221
function documentValue(tuples: any) {
222222
const message = Object.create(null);
223223

224+
if(!tuples) {
225+
return message;
226+
}
227+
224228
let i = 0;
225229
while (i < tuples.length) {
226230
const key = tuples[i++],

0 commit comments

Comments
 (0)