a) Use combination column name: total_hits and user_id, instead of user_id b) You can use combination key: word_id1 and word_id2
On Sun, Jan 17, 2010 at 6:18 PM, Alex Dong <alex.d...@binaryplex.com> wrote: > Hi folks, > > I'm new to Cassandra. I'm evaluating Cassandra, HBase and Voldemort to see > which one matches our app model better. Here is a typical data model: > > stats { > word_id: { > user_id: { > total_hits: 193, > monthly_hits: [2, 31, 21, 10, 10, 7, 8, 0, 0, 0, 1, > 2] > }, > .. > } > ... > } > > I'm sure that I can pull all the data out from Cassandra and use mapreduce > to sort or merge. But I'm wondering are there any way in cassandra to > 'automate' this process: > 1) for a given 'word_id', get a list of user_id: { } sorted by > 'total_hits'? > 2) for two 'word_id's, get an 'intersect' result of the user: {} list > sorted by the combined 'total_hits'? > > Cheers, > Alex > -- Best regards, JKnight