Redis Query

22 views
Skip to first unread message

Priyanka Makkar

unread,
Jan 23, 2018, 8:01:19 AM1/23/18
to Redis DB
Hi,

I want to build my cache in a way that I could query the data on multiple parameters. 
Below is the sample json stored in cache -

{

"Body": "This is new post4",

"MessageId": 876543,

"LikesCnt": 0,

"Likenames": null,

"CmntsCnt": 0,

"CreateDate": "0001-01-01T00:00:00",

"UpdateDate": "0001-01-01T00:00:00",

"SenderID": 123456,

"SenderName": null,

"PictureUrl": null,

"BU": "BU1",

"Country": "US",

"Topic": "LnD",

"Blocked": false,

"Comments": null

}


Similiar to above, we will have multiple jsons for different conversations.I want to query all the keys on the basis of BU and Country.

Example, Get all the conversations with BU as BU1 or Global and Country as US or Global.

What is the best way to achieve this? What data type should we use to store the value?

Itamar Haber

unread,
Jan 23, 2018, 8:57:02 AM1/23/18
to Redis DB
Hello Priyanka,

While Redis does not provide built-in search-by-value mechanisms, you can use its data structures to "index" your data. More details are at https://redis.io/topics/indexes.

Alternatively, for a robust search engine as a Redis module, you can look at http://redisearch.io (disclaimer: I am affiliated with that project).

Cheers,

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+unsubscribe@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.



--

Itamar Haber | Technology Evangelist
Redis Labs ~/redis

Mobile: +972 (54) 567 9692
Twitter: @itamarhaber
Skype: itamar.haber

Priyanka Makkar

unread,
Jan 24, 2018, 4:55:25 AM1/24/18
to Redis DB
Hi Itamar,

Thanks for the reply!. How can we install Redis Search in Windows machine?

Regards,
Priyanka

Itamar Haber

unread,
Jan 24, 2018, 5:49:26 AM1/24/18
to Redis DB
Redis modules require having v4 - afaik there is no native Windows version. You could use a VM or WSL to run the official project however.

--
Reply all
Reply to author
Forward
0 new messages