1

I am currently working on a project that uses Redis from NodeJs and a lot of the data is stored in Redis as JSON strings. What I have are a number of keys i.e.

 urn:comment:1, urn:comment:2 etc and the values contained are:

"{Id:1, CommentText:"some text here that could be quite large..." ...} etc

What I need is a way to search for strings in "CommentText".

I am new to Redis, what are my options?

JD.
  • 15,171
  • 21
  • 86
  • 159
  • Somewhat off topic, but lots of other DBs were created to let you access objects directly instead of as strings. MongoDB would let you query on object fields. In Redis can you use a hash instead? – Jamund Ferguson Dec 17 '12 at 17:51
  • Redis does have hashes but not sure if I should go that way as I am supposed to be maintaining the project. Switching to hashes may be a lot of work (still a newbie at the mo) – JD. Dec 17 '12 at 18:02
  • 2
    Right @JD. It sounds like you're trying to do something that Redis isn't awesome at doing. Implementing search in Redis is totally doable using some of these concepts: http://stackoverflow.com/questions/6401194/how-do-i-search-strings-in-redis. But for me, I'd probably reach for MongoDB if I wanted to query JSON objects. – Jamund Ferguson Dec 17 '12 at 20:56

1 Answers1

1

Redis is not well suited for what you want. Since you want full text search functionality i strongly recommend using Elastic Search elasticsearch.org

PanKak
  • 133
  • 12