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
fix: handle different Redis return types for num_docs field (#639)
Fix ClassCastException when retrieving document count from Redis index info.
Redis can return num_docs as either String or Long depending on version/config.
Applied robust type checking to all occurrences:
- RedisJSONKeyValueAdapter.count()
- RedisEnhancedKeyValueAdapter.count()
- RedisFluentQueryByExample (already fixed in SearchStreamImpl)
The fix handles:
- String values: parse to Long
- Number values: convert to long
- Null/unexpected: return 0L safely
This is more robust than PR #640's approach as it:
- Handles multiple Redis return types
- Avoids NullPointerException
- Prevents unnecessary String conversions
- Provides safe fallback for unexpected types
0 commit comments