I have an index with a numeric field time_QUEUED.
> ft.search /h/t/idx * sortby time_QUEUED return 1 time_QUEUED
1) (integer) 5
2) "/h/t/d/922daf3d-04ab-41a0-b72e-93ac469cf3c1"
3) 1) "time_QUEUED"
2) "1583500901.55"
4) "/h/t/d/eeba5082-4e33-48ff-a937-5f1a31069bf0"
5) 1) "time_QUEUED"
2) "1583501038.48"
6) "/h/t/d/5faebed5-24d1-49c5-8fd9-bb4f76d811ac"
7) 1) "time_QUEUED"
2) "1583501038.47"
8) "/h/t/d/343e2d27-1937-436d-9c1f-b110833d30bc"
9) 1) "time_QUEUED"
2) "1583501038.62"
10) "/h/t/d/db3b0302-a9b1-4b1a-ac43-f74b9bb7c256"
11) 1) "time_QUEUED"
2) "1583501038.63"
Now I expect this to return the last record:
> ft.search /h/t/idx "@time_QUEUED:[1583501038.63 +inf]"
1) (integer) 0
And this to return 2 last records:
> ft.search /h/t/idx "@time_QUEUED:[1583501038.62 +inf]"
1) (integer) 0
I only start getting results when the floor of the condition is the largest integer not greater than the results:
> ft.search /h/t/idx "@time_QUEUED:[1583501038.0 +inf]" return 1 time_QUEUED
1) (integer) 4
2) "/h/t/d/db3b0302-a9b1-4b1a-ac43-f74b9bb7c256"
3) 1) "time_QUEUED"
2) "1583501038.63"
4) "/h/t/d/eeba5082-4e33-48ff-a937-5f1a31069bf0"
5) 1) "time_QUEUED"
2) "1583501038.48"
6) "/h/t/d/343e2d27-1937-436d-9c1f-b110833d30bc"
7) 1) "time_QUEUED"
2) "1583501038.62"
8) "/h/t/d/5faebed5-24d1-49c5-8fd9-bb4f76d811ac"
9) 1) "time_QUEUED"
2) "1583501038.47"
Float condition works, too, as long as it's less than the floored results:
> ft.search /h/t/idx "@time_QUEUED:[1583501037.99 +inf]" return 1 time_QUEUED
1) (integer) 4
2) "/h/t/d/db3b0302-a9b1-4b1a-ac43-f74b9bb7c256"
3) 1) "time_QUEUED"
2) "1583501038.63"
4) "/h/t/d/eeba5082-4e33-48ff-a937-5f1a31069bf0"
5) 1) "time_QUEUED"
2) "1583501038.48"
6) "/h/t/d/343e2d27-1937-436d-9c1f-b110833d30bc"
7) 1) "time_QUEUED"
2) "1583501038.62"
8) "/h/t/d/5faebed5-24d1-49c5-8fd9-bb4f76d811ac"
9) 1) "time_QUEUED"
2) "1583501038.47"
Am I using a wrong syntax? Does it work like this by design? Is there a workaround to do an exact search?
Thanks
"FT.SEARCH" "/h/t/idx" "@time_QUEUED:[-inf 1583932226.83]" "SORTBY" "time_QUEUED" "DESC" "LIMIT" "0" "26" "RETURN" 1 "time_QUEUED"
> "FT.SEARCH" "/h/t/idx" "@time_QUEUED:[-inf 1583932226.83]" "SORTBY" "time_QUEUED" "DESC" "LIMIT" "0" "1" "RETURN" 1 "time_QUEUED"
1) (integer) 6
2) "/h/t/d/e2ad3448-7f9a-4fb8-b6be-710d35d880c5"
3) 1) "time_QUEUED"
2) "1583932226.83"
> HGET "/h/t/d/e2ad3448-7f9a-4fb8-b6be-710d35d880c5" time_QUEUED
"1583932226.825489"