RediSearch / redisearch-go

Go client for RediSearch
https://redisearch.io
BSD 3-Clause "New" or "Revised" License
288 stars 65 forks source link

nil results panic (maybe a document expiry issue?) #181

Open Leila-Codes opened 1 year ago

Leila-Codes commented 1 year ago

On occasion some document results may return a valid key but the document value is nil.

Unfortunately I don't yet have a specific repeatable case but the theory/suspicion is:

  1. JSON Document Added and Expiry is Set
  2. Search is run
  3. Document expires during query
  4. Document returned has valid key, but value is nil.

This is unhandled when casting inside loadDocument() which completely crashes reading of data.

Proposed solution is to handle cast errors appropriately. Will submit a new PR shortly with implementation.

Leila-Codes commented 1 year ago

Added new PR #182

danielpcox commented 1 year ago

I have this problem too. In my case, the Redis connection is temporarily lost, and this results in a nil result.