-
Notifications
You must be signed in to change notification settings - Fork 573
Closed
Labels
Description
Describe the bug
I noticed that FT.INFO num_docs returns incorrect numbers because it seems it includes replication factor. i.e. when there is master + 1 replica, num_docs is doubled.
To Reproduce
Steps to reproduce the behavior:
- Create index with documents in setup with 1 master + 1 replica
- Check FT.SEARCH result with
limit 0 0. Quote: "You can use LIMIT 0 0 to count the number of documents in the result set without actually returning them." - Check FT.INFO , num_docs field. Value will be equal result of
FT.SEARCH ... limit 0 0multiplied by 2.
Expected behavior
From my understanding, num_docs should show amount of docs in search index without taking into account replication factor. Also I checked other fields in FT.INFO output and they don't match FT.SEARCH results either.
Maybe some other field should be added to not break existing monitoring, but I believe it would be useful to have metric which shows amount of documents in search index without multiplication by replicas count.
Environment (please complete the following information):
- OS: Ubuntu 24.04
- Version/branch: Redis v8.0, but I think it's reproducible on v7.4 as well
Additional context
None
Reactions are currently unavailable