You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Sébastien Druon <sd...@spotuse.com> on 2010/12/13 12:25:01 UTC

Hector and secondary indexes

Hello!

How is it possible to query a secondary index with Hector?
The equivalent of the following CLI command for example:
get users where birth_date = 1973;
with a secondary index defined on birth_date

Thanks in advance for the help

Sebastien Druon


Re: Hector and secondary indexes

Posted by Nate McCall <na...@riptano.com>.
In the hector source tree, IndexedSlicesQueryTest should provide some
additional examples:
https://github.com/rantav/hector/blob/master/core/src/test/java/me/prettyprint/cassandra/model/IndexedSlicesQueryTest.java

A stand-alone example that might be easier to experiment with can be found here:
https://github.com/zznate/hector-examples/blob/master/src/main/java/com/riptano/cassandra/hector/example/GetIndexedSlices.java

For detailed Hector questions, feel free to join our mailing list as well:
hector-users@googlegroups.com


On Mon, Dec 13, 2010 at 6:19 AM, Jake Luciani <ja...@gmail.com> wrote:
> There is an example using hector here:
> http://www.riptano.com/blog/whats-new-cassandra-07-secondary-indexes
>
> On Mon, Dec 13, 2010 at 6:25 AM, Sébastien Druon <sd...@spotuse.com> wrote:
>>
>> Hello!
>>
>> How is it possible to query a secondary index with Hector?
>> The equivalent of the following CLI command for example:
>> get users where birth_date = 1973;
>> with a secondary index defined on birth_date
>>
>> Thanks in advance for the help
>>
>> Sebastien Druon
>>
>
>

Re: Hector and secondary indexes

Posted by Jake Luciani <ja...@gmail.com>.
There is an example using hector here:
http://www.riptano.com/blog/whats-new-cassandra-07-secondary-indexes

On Mon, Dec 13, 2010 at 6:25 AM, Sébastien Druon <sd...@spotuse.com> wrote:

> Hello!
>
> How is it possible to query a secondary index with Hector?
> The equivalent of the following CLI command for example:
> get users where birth_date = 1973;
> with a secondary index defined on birth_date
>
> Thanks in advance for the help
>
> Sebastien Druon
>
>