Reputation: 4918
For example: consider that a hash (lets call it Event) has two searchable properties: user_id (num) and name (text).
However, whenever I need to filter events by name I aways have the user_id at hand. So I am wondering if it makes sense to have one index of events per user instead of one big index of events for all users.
From my basic knowledge with Redis and RediSearch:
Upvotes: 0
Views: 434
Reputation: 9568
@jonathan it depends on your performance requirements and available memory.
If memory is not an issue (indexing the same doc twice) and you want to reduce the latency to a minimum then that sounds like an optional option.
With one caveat creating so many indexes has an overhead on the GC therefore you should only consider it if the user level index is pretty static or short live and you can define it as TEMPORARY
(can be with endless timeout)
See: https://oss.redis.com/redisearch/Commands/#ftcreate
Upvotes: 2