Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 577986923 for ; Tue, 28 Jun 2011 22:11:21 +0000 (UTC) Received: (qmail 66137 invoked by uid 500); 28 Jun 2011 22:11:19 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 66066 invoked by uid 500); 28 Jun 2011 22:11:18 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 66055 invoked by uid 99); 28 Jun 2011 22:11:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Jun 2011 22:11:18 +0000 X-ASF-Spam-Status: No, hits=3.9 required=5.0 tests=FREEMAIL_FROM,FREEMAIL_REPLY,FROM_LOCAL_NOVOWEL,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jnbdzjnbdz@gmail.com designates 209.85.161.172 as permitted sender) Received: from [209.85.161.172] (HELO mail-gx0-f172.google.com) (209.85.161.172) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Jun 2011 22:11:09 +0000 Received: by gxk19 with SMTP id 19so329944gxk.31 for ; Tue, 28 Jun 2011 15:10:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=4+SstF2kXKViC8Y8gr4KPJtNYyZfzvL/z0krJ22Reb4=; b=EIv8Vo73WZ1haBRm/99vqcSbfUeMpBaG2EMddNX7n0WfRfvQ1k4LYbP9oPcyKrEA6J GoMvgELS+hfdCbBRC8Gx/quOdTlT+cgbZChcrApG41Bq6Bk06K0jHe45rLTutcd6gRY7 a23o2ijJL1Nd4p8XuO+LQzBIhXr4cA+1VC5Nw= MIME-Version: 1.0 Received: by 10.236.173.167 with SMTP id v27mr69382yhl.378.1309299048550; Tue, 28 Jun 2011 15:10:48 -0700 (PDT) Received: by 10.236.153.6 with HTTP; Tue, 28 Jun 2011 15:10:48 -0700 (PDT) In-Reply-To: References: Date: Tue, 28 Jun 2011 18:10:48 -0400 Message-ID: Subject: Re: Problem with PHPCassa accessing Indexes From: Jean-Nicolas Boulay Desjardins To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sorry, my mistake. The variable name was wrong. Weird, I did not get any er= rors. Thanks anyways. But I do Have a another question. When looking in cassandra-cli I did "get Users[jnbdz];" and I got: A long is exactly 8 bytes: 10 And I don't get the data. Am I missing something? Thanks in advance. On Tue, Jun 28, 2011 at 6:00 PM, Tyler Hobbs wrote: > What does the ouput of 'describe keyspace ' show for the > keyspace the CF is in? > > On Tue, Jun 28, 2011 at 2:35 PM, Jean-Nicolas Boulay Desjardins > wrote: >> Actually I am not getting any results from: get_indexed_slices() >> >> It seems my code dies at: $rows =3D >> $column_family->get_indexed_slices($index_clause); >> >> Because everything after that is echo is not shown on the page. >> >> Plus I don't get any errors. >> >> Any ideas? >> >> On Tue, Jun 28, 2011 at 3:23 PM, Tyler Hobbs wrote: >>> The result of get_indexed_slices() is an Iterator object, not an >>> array. =A0It doesn't look like you're treating it accordingly. >>> >>> See the bottom of this section for an example: >>> http://thobbs.github.com/phpcassa/tutorial.html#indexes >>> >>> On Tue, Jun 28, 2011 at 2:06 PM, Jean-Nicolas Boulay Desjardins >>> wrote: >>>> Hi, >>>> >>>> I am having problem accessing data via an index with PHPCassa. I have >>>> var_dump() the results: >>>> >>>> array(6) { ["birthdate"]=3D> int(3546927995491989807) ["email"]=3D> >>>> string(20) "jnbdzjnbdz@gmail.com" ["firstname"]=3D> string(12) >>>> "Jean-Nicolas" ["lastname"]=3D> string(17) "Boulay Desjardins" >>>> ["password"]=3D> string(8) "password" ["username"]=3D> string(5) "jnbd= z" } >>>> >>>> object(cassandra_IndexExpression)#76 (3) { ["column_name"]=3D> string(= 5) >>>> "email" ["op"]=3D> int(0) ["value"]=3D> string(20) "jnbdzjnbdz@gmail.c= om" >>>> } >>>> >>>> object(cassandra_IndexClause)#77 (3) { ["expressions"]=3D> array(1) { >>>> [0]=3D> object(cassandra_IndexExpression)#76 (3) { ["column_name"]=3D> >>>> string(5) "email" ["op"]=3D> int(0) ["value"]=3D> string(20) >>>> "jnbdzjnbdz@gmail.com" } } ["start_key"]=3D> string(0) "" ["count"]=3D= > >>>> int(100) } >>>> >>>> Here is the code: >>>> >>>> $columnFamily =3D CASSANDRA::selectColumnFamily('Users'); >>>> >>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 $this->selectUser =3D $c= olumnFamily->get('jnbdz'); >>>> >>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 var_dump($this->selectUs= er); >>>> >>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 echo '
'; >>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 echo '
'; >>>> >>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 $index_exp =3D >>>> CassandraUtil::create_index_expression('email', >>>> 'jnbdzjnbdz@gmail.com'); >>>> var_dump($index_exp); >>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 $index_clause =3D >>>> CassandraUtil::create_index_clause(array($index_exp)); >>>> echo '
'; >>>> echo '
'; >>>> var_dump($index_clause); >>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 $rows =3D $column_family= ->get_indexed_slices($index_clause); >>>> echo '
'; >>>> echo '
'; >>>> var_dump($rows); >>>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 var_dump($row); >>>> >>>> Thanks in advance for any help >>>> >>> >>> >>> >>> -- >>> Tyler Hobbs >>> Software Engineer, DataStax >>> Maintainer of the pycassa Cassandra Python client library >>> >> >> >> >> -- >> Name / Nom: Boulay Desjardins, Jean-Nicolas >> Website / Site Web: www.jeannicolas.com >> > > > > -- > Tyler Hobbs > Software Engineer, DataStax > Maintainer of the pycassa Cassandra Python client library > --=20 Name / Nom: Boulay Desjardins, Jean-Nicolas Website / Site Web: www.jeannicolas.com