Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Basically to support you queries you need to have </p> <pre><code>create column family ProductFamilies with comparator='CompositeType(UTF8Type, Int32Type, Int32Type, Int32Type, Int32Type, Int32Type, LongType, UTF8Type)' and key_validation_class='UTF8Type' </code></pre> <p>or</p> <pre><code>CREATE TABLE ProductFamilies ( ID varchar, PriceLow int, PriceHigh int, MassLow int, MassHigh int, MnfGeo int, MnfID bigint, Data varchar, PRIMARY KEY (ID, PriceLow, PriceHigh, MassLow, MnfGeo, MnfID, Data) ); </code></pre> <p><strike> Now you can query</p> <pre><code>SELECT Data FROM MyApp.ProductFamilies WHERE ID IN (?, ?, ?) AND PriceLow &gt;= ? AND PriceHigh &lt;= ? AND MassLow &gt;= ? AND MassHigh &lt;= ? and MnfGeo &gt;= ? AND MnfGeo &lt;= ? </code></pre> <p>Provided you don't miss any column from left to right [although not a filter but atleast a *] and all your values are in the column names rather the value. </strike></p> <p>One more thing you should understand about composite columns is "Column Slice must be contiguous" So, pricelow > =10 and pricelow &lt;= 40 will return you a contiguous slice but filtering the result set with masslow and other columns will not work as it is not going to result in a contiguous slice. BTW pricelow = 10 and masslow &lt;= 20 and masslow >=10 should work [tested with phpcassa] as it will result in a contiguous slice once again.</p> <p>Else create a or multiple secondary index on any of the column of yours. Then you have the rights to query based on column values provided you always have atleast one of the indexed field in query. <a href="http://www.datastax.com/docs/1.1/ddl/indexes" rel="nofollow">http://www.datastax.com/docs/1.1/ddl/indexes</a></p> <p>Regarding you material question there is no other go than having an inverted index if it is going to be a multivalued column as of I know.</p> <p>It would be great if @jbellis verifies this</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload