0

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

4

1 回答 1

1

目前,您需要创建另一个 ColumnFamily,例如 UserSex,并使原始 CF 中的每个索引值成为新 CF 中的键。因此,您将拥有 'male' 和 'female' 作为键,其中任一列的用户 id 或(非规范化)包含整个用户记录的超列,因此您不必在索引获取后执行 multiget。

于 2010-01-27T15:19:38.177 回答