Indexing Configuration

phnguyen edited this page May 29, 2012 · 6 revisions
  1. Schema
Cassandra wide-row indexing expects the following schema to be available:
 Indexing
   Configuration
   Indexes

Where Indexing is a keyspace; Configuration is a column family under which indexes are configured; and Indexes is where to house actual indexes.

  1. Configuration
A column family may have multiple indexes. Each index needs a configuration row under Configuration CF as below:
 <ks>_<cf>_<col1>_<col2>_idx (row key)
   keyspace: <ks>
   column_family: <cf>
   columns: <col1>, <col2>

Where:

  • <ks>, <cf> are keyspace and column family that you are configuring indexing for;
  • <col1>, <col2> are columns whose values will get indexed.
Note: Newly added configuration won't take effect until after 30 seconds (configuration refresh interval).
  1. JSON Indexing
If you store a JSON string in a Cassandra column, and want to index a particular field of that JSON then here is the configuration you need:
 <ks>_<cf>_<col1>:<field1>:<field2>_<col2>_idx (row key)
   keyspace: <ks>
   column_family: <cf>
   columns: <col1>:<field1>:<field2>, <col2>

Where:

  • <col1> is a full name or prefix of a Cassandra column housing JSON string;
  • <field1>, <field2> make up a path to the JSON field to be indexed.
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.