RediSearch / RediSearch

A query and indexing engine for Redis, providing secondary indexing, full-text search, vector similarity search and aggregations.
https://redis.io/docs/stack/search/
Other
5.51k stars 522 forks source link

[FEATURE REQUEST] FT.Search to return JSON booleans as boolean with RESP3 #4885

Open granit1986 opened 3 months ago

granit1986 commented 3 months ago

Describe the bug We have a record with fields of type bool. If we call FT.Search with all fields, then bool is returned as true/false. If you add the RETURN parameter with the same fields, then 0/1 is returned

Expected behavior Return data in the same format for the RETURN parameter and without

Screenshots image image

Environment (please complete the following information): RedisSearch 2.8.11 RedisJSON 2.6.9

GuyAv46 commented 3 months ago

Hey @granit1986, thanks for reaching out.

This is not a bug - when this feature was implemented, redis RESP3 did not exist yet, and redis did not support a boolean type. Today redis does support a boolean type with RESP3. I'm converting this issue into a feature request

granit1986 commented 3 months ago

@GuyAv46 Thanks for the answer. This applies not only to bool. We use Redis.OM for .NET and byte[] and TimeSpan also stop working. They stop serializing into the required types

GuyAv46 commented 3 months ago

OK. On RediSearch this is the behavior for JSON types for over 3 years. I’ll verify I haven’t missed any recent change. When did it stop working? It might be a bug in the specific client

granit1986 commented 3 months ago

Ok. Perhaps it's the client's behavior. I'm using RediSearch for the first time and saw this difference with and without RETURN in the RedisInsight profiler and deserialization errors

github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 60 days with no activity.