redisearch for structured data (analytics)

I am trying to use redisearch to index analytics events for my website (pageviews etc…). An event is represented as a hash (document) and its fields mainly store identifiers instead of free-text - e.g.:

field1: p123

field2: p456,p123

What is the most efficient way to index these fields in redisearch? I have used tags before, but with a smaller tag population (e.g. a few thousand). In this case, there will be millions of different ids.

I would like to do equality constraints (i.e. not really search). I currently use TEXT NOSTEM for these fields, and my index is also created with NOOFFSETS NOFREQS.

Thanks

Tags seems like exactly what you need.

In the case where there are millions of these tags, and each tag points to very few documents (e.g. hundreds at most), is tags more efficient in terms of space, and speed, than TEXT?

Thank you

Yes tags are more efficient, first they are only tokenize by ‘,’ so it will create much less entries in the tag trie, second they are saved only in the trie so it will not create any extra key for each value. Regarding speed, should be more or less the same.