views:

199

answers:

1

How can i get the keys of the column having sex = male. Using the php library from http://wiki.apache.org/cassandra/ClientExamples

For example my keys are

0,1,2

key: 0 { column( name:age, value:24), column( name:sex, value:female) }

key: 1 { column( name:age, value:24), column( name:sex, value:female) }

key: 2 { column( name:age, value:26), column( name:sex, value:male) }

+1  A: 

Currently you need to create another ColumnFamily, e.g. UserSex, and make each indexed value in the original CF a key in the new one. So you would have 'male' and 'female' be keys, with either columns of the user id, or (denormalizing) supercolumns containing the entire user record, so you don't have to do a multiget after the index get.

jbellis