Yes, but as I said it may not be the optimal design. Y= ou may end up with a single row very big row.

- you could use mult= iple rows, each holding a range of counts.

- you could use a stand= ard CF and store the count in the row key, then use get_range_slices. Usin= g the random partition you will need to sort them yourself, if you use the= Order preserving Partitioner they will be sorted for you.
e.g. {
&= nbsp;SearchLogs:
999 : {word1:word1}
998 : {word2 : wo= rd2}
}

get_range_slices over the RandomPartioner has some perfor= mance issues when compared to OrderPerservingPartioner. But I think the fe= ature returns the same data, just out of order. Try some experiments and s= ee what happens.

Do you want to read back a portion of the index (= e.g. words with 800 to 900 occurrences) or the entire index ?
Aaron
=

On 30 Jul, 2010,at 10:04 AM, Mark <static.void.dev@gmail.com>= ; wrote:

Ok so basically an "array" of words grouped by their count?
=0A
=0A= Something like this?
=0A
=0A{
=0A SearchLogs : {
=0A = ALL : {
=0A 999: { word1:word1, word2:word2, word3:word3 }=0A 998: { word1:word1, word2:word2, word3:word3 }
=0A = }
=0A }
=0A}
=0A
=0AOn 7/29/10 2:50 PM, Aaron Morton wro= te:
=0A> One method would be to use a Super Column Family. Have one = row, in
=0A> that create a column family for each count value you h= ave, and then in
=0A> the super column create a column for each wor= d.
=0A>
=0A> Set the CompareWith for the super col to be LongT= ype and the
=0A> CompareSubcolumnsWith to be AsciiTyoe or UTFType.<= br>=0A>
=0A> You could then use get_slice to read super columns i= n that row.
=0A>
=0A> This may not be the most efficient model= , it will depend how how much
=0A> data you have and what your read= patterns are like. Also be remember
=0A> that pre 0.7 you cannot a= tomically increment counters in cassandra.
=0A>
=0A> Have a pl= ay and see what works for you.
=0A>
=0A> Aaron
=0A>
=0A= > On 29 Jul, 2010,at 02:36 PM, Mark <static.void.dev@gmail.com> w= rote:
=0A>
=0A>> I know there is no native support for "ord= er by", "group by" etc but I
=0A>> was wondering how it could be = accomplished with some custom indexes?
=0A>>
=0A>> For e= xample, say I have a list of word counts like (notice 2 words have
=0A&= gt;> the same count):
=0A>>
=0A>> "cassandra" =3D>= 100
=0A>> "foo" =3D> 999
=0A>> "bar" =3D> 1
=0A= >> "baz" =3D> 500
=0A>> "fooz" =3D> 999
=0A>>= ;
=0A>> How can I store then retrieve these words ordered by thei= r count/values?
=0A>>
=0A>> Thanks.
=0A
=0A
<= /div>
--Apple-Webmail-86--417cd07e-284a-4769-ec50-f20a19551263-- --Apple-Webmail-42--417cd07e-284a-4769-ec50-f20a19551263--