简体   繁体   中英

How can I get the key of a colum in cassandra using php?

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

Currently you need to create another ColumnFamily, eg 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM