Question

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) }

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top