You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per the documentation, a -1 count in the substr function is supposed to return the rest of the string from the offset.
Return the substring of s, starting at offset and having count characters.
If offset is negative, it represents the distance from the end of the string.
If count is -1, it means "the rest of the string starting at offset".
That's not what is happening. See example below. Redis Search version = 2.8.12
> FT.CREATE idx SCHEMA date TEXT SORTABLE
"OK"> HSET key date "04-03-2024"
(integer) 1
> FT.AGGREGATE idx * APPLY 'substr(@date,6,-1)' AS Year
1) "1"
2) 1) "date"
2) "04-03-2024"
3) "Year"
4) "202"
The text was updated successfully, but these errors were encountered:
joeywhelan
changed the title
[BUG] APPLY substr function not honoring -1 count
[BUG] APPLY substr function not using -1 count as documented
Apr 3, 2024
GuyAv46
changed the title
[BUG] APPLY substr function not using -1 count as documented
[BUG] APPLY substr function not using -1 count as documented - [MOD-6959]
Apr 21, 2024
Per the documentation, a -1 count in the substr function is supposed to return the rest of the string from the offset.
That's not what is happening. See example below. Redis Search version = 2.8.12
The text was updated successfully, but these errors were encountered: