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 9720C6452 for ; Tue, 28 Jun 2011 22:00:41 +0000 (UTC) Received: (qmail 45682 invoked by uid 500); 28 Jun 2011 22:00:39 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 45629 invoked by uid 500); 28 Jun 2011 22:00:38 -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 45621 invoked by uid 99); 28 Jun 2011 22:00:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Jun 2011 22:00:38 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of tyler@datastax.com designates 209.85.213.44 as permitted sender) Received: from [209.85.213.44] (HELO mail-yw0-f44.google.com) (209.85.213.44) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Jun 2011 22:00:32 +0000 Received: by ywp31 with SMTP id 31so341202ywp.31 for ; Tue, 28 Jun 2011 15:00:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.59.1 with SMTP id h1mr128099yba.140.1309298410179; Tue, 28 Jun 2011 15:00:10 -0700 (PDT) Received: by 10.150.205.6 with HTTP; Tue, 28 Jun 2011 15:00:10 -0700 (PDT) X-Originating-IP: [64.132.24.216] In-Reply-To: References: Date: Tue, 28 Jun 2011 17:00:10 -0500 Message-ID: Subject: Re: Problem with PHPCassa accessing Indexes From: Tyler Hobbs To: user@cassandra.apache.org, phpcassa@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org 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) "jnbdz= " } >>> >>> object(cassandra_IndexExpression)#76 (3) { ["column_name"]=3D> string(5= ) >>> "email" ["op"]=3D> int(0) ["value"]=3D> string(20) "jnbdzjnbdz@gmail.co= m" >>> } >>> >>> 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 $co= lumnFamily->get('jnbdz'); >>> >>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 var_dump($this->selectUse= r); >>> >>> =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 > --=20 Tyler Hobbs Software Engineer, DataStax Maintainer of the pycassa Cassandra Python client library