Regardless the programming language, to do this efficiently you'll need to maintain an "index" key that maps somevalue to the key names. Using a Set or a Sorted Set for this is what you should usually do - i.e. add new key names to it and remove them according to their values - and get that key's contents when you want to "search".
There are some libraries (i.e. gems) that may provide this sort of functionality ready to use - look into the most excellent Ohm in your case.
EDIT
My keys are xyz => {:status=> "connected", :topic=> "ABC"} PQR => {:status=> "connected", :topic=> "ABC"} Now I need to find all the KEYS where topic is "ABC"
I would store xyz's value as a String or a Hash (depending on whether I need to update/read just parts of it or not). Then I would SADD topic:ABC xyz
and do SMEMBERS
or SSCAN
on it to get the names of all keys with that topic. I'd also try to remember to SREM
the relevant member from topic:ABC when I DEL
its key...