title: cassandra filtering on an indexed column isn't working
body: <p>I'm using (the latest version of) Cassandra nosql dbms to model some data.</p>
  
  <p>I'd like to get a count of the number of active customer accounts in the last month.</p>
  
  <p>I've created the following table:</p>
  
  <pre><code>CREATE TABLE active_accounts
  (
      customer_name   text, 
      account_name    text, 
      date            timestamp, 
      PRIMARY KEY ((customer_name, account_name))
  );
  </code></pre>
  
  <p>So because I want to filter by date, I create an index on the date column:</p>
  
  <pre><code>CREATE INDEX ON active_accounts (date);
  </code></pre>
  
  <p>When I insert some data, Cassandra automatically updates data on any existing primary key matches, so the following inserts only produce two records:</p>
  
  <pre><code>insert into active_accounts (customer_name, account_name, date) Values ('customer2', 'account2', 1418377413000);
  insert into active_accounts (customer_name, account_name, date) Values ('customer1', 'account1', 1418377413000);
  insert into active_accounts (customer_name, account_name, date) Values ('customer2', 'account2', 1418377414000);
  insert into active_accounts (customer_name, account_name, date) Values ('customer2', 'account2', 1418377415000);
  </code></pre>
  
  <p>This is exactly what I'd like - I won't get a huge table of data, and each entry in the table represents a unique customer account - so no need for a select distinct.</p>
  
  <p>The query I'd like to make - is how many distinct customer accounts are active within the last month say:</p>
  
  <pre><code> Select count(*) from active_accounts where date &gt;= 1418377411000 and date &lt;= 1418397411000 ALLOW FILTERING;
  </code></pre>
  
  <p>In response to this query, I get the following error:</p>
  
  <pre><code>code=2200 [Invalid query] message="No indexed columns present in by-columns clause with Equal operator"
  </code></pre>
  
  <p>What am I missing; isn't this the purpose of the Index I created?</p>