In this use case you don't need the secondary index. Instead use Primary
key(partition_id, senttime)

Thanks

Jabbar Azam
On 12 Jun 2014 23:44, "Roshan" <codeva...@gmail.com> wrote:

> Hi
>
> Cassandra - 2.0.8
> DataStax driver - 2.0.2
>
> I have create a keyspace and a table with indexes like below.
> CREATE TABLE services.messagepayload (
>   partition_id uuid,
>   messageid bigint,
>   senttime timestamp,
>   PRIMARY KEY (partition_id)
> ) WITH compression =
>     { 'sstable_compression' : 'LZ4Compressor', 'chunk_length_kb' : 64 };
>
> CREATE INDEX idx_messagepayload_senttime ON services.messagepayload
> (senttime);
>
> While I am running the below query I am getting an exception.
>
> SELECT * FROM b_bank_services.messagepayload WHERE senttime>=1401544800000
> AND senttime<=1401717600000 ALLOW FILTERING;
>
> com.datastax.driver.core.exceptions.InvalidQueryException: No indexed
> columns present in by-columns clause with Equal operator
>
> Could someone can explain what's going on? I have create a index to the
> search column, but seems not working.
>
> Thanks.
>
>
>
> --
> View this message in context:
> http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/CQL-query-regarding-indexes-tp7595122.html
> Sent from the cassandra-u...@incubator.apache.org mailing list archive at
> Nabble.com.
>

Reply via email to