Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 59034 invoked from network); 22 Jun 2009 03:01:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Jun 2009 03:01:48 -0000 Received: (qmail 58448 invoked by uid 500); 22 Jun 2009 03:01:59 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 58361 invoked by uid 500); 22 Jun 2009 03:01:58 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 58347 invoked by uid 99); 22 Jun 2009 03:01:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jun 2009 03:01:58 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [209.85.216.185] (HELO mail-px0-f185.google.com) (209.85.216.185) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jun 2009 03:01:49 +0000 Received: by pxi15 with SMTP id 15so3068992pxi.13 for ; Sun, 21 Jun 2009 20:01:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.214.5 with SMTP id m5mr2404573wfg.37.1245639688605; Sun, 21 Jun 2009 20:01:28 -0700 (PDT) In-Reply-To: <69a992ac0906201915p5d3073l8af5812ed411d76d@mail.gmail.com> References: <69a992ac0906191748q160ac0fct5c26c408da593bbf@mail.gmail.com> <69a992ac0906191802l160d5937qf4b723bffd8c9928@mail.gmail.com> <69a992ac0906201915p5d3073l8af5812ed411d76d@mail.gmail.com> Date: Mon, 22 Jun 2009 13:01:28 +1000 Message-ID: <55047b710906212001i2a0aa70clb6e0d974f47be9fc@mail.gmail.com> Subject: Re: view sorting and group question? From: Nicholas Orr To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=000e0cd2e12c285140046ce71745 X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd2e12c285140046ce71745 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit You could use another tool like ExtJS on the client side to filter and sort results. I'm using the Ext.grid.GridPanel with a Ext.ux.data.JsonPagingStore. However there are things to consider with this particular approach. The JsonPagingStore retrieves the whole set of data returned from the view and stores it client side to filter & sort. Using start_key & end_key doesn't apply so if your data grows to be like 2000 records, 2000 records will be loaded by the grid :) I won't reach 30 records with what I'm doing so it's fine to have 30 records coming down the wire to the client. Plus other thing to consider with this approach is it means learning ExtJS which isn't exactly simple, take a bit of effort ;) Nick On Sun, Jun 21, 2009 at 12:15 PM, hhsuper wrote: > but if i need to use the view as a datasource to the web page, i need > change > to right view to query on every sorting? > > On Sun, Jun 21, 2009 at 3:42 AM, Paul Davis >wrote: > > > On Fri, Jun 19, 2009 at 9:02 PM, hhsuper wrote: > > > thanks paul, > > > > > > do you mean i need another view to resolve this, the difference between > > them > > > are the key order? > > > > > > > Yeah, if you're wanting to 'resort' a view, the CouchDB way is to > > create a second view for each 'sort order'. > > > > HTH, > > Paul Davis > > > > > i mean i want to group or sort not with start at the first key, could i > > > achieve this goal in only view? > > > > > > On Sat, Jun 20, 2009 at 8:51 AM, Paul Davis < > paul.joseph.davis@gmail.com > > >wrote: > > > > > >> If you want different key sorting then you'll need to emit different > > >> keys. The same goes for grouping differently. > > >> > > >> Paul Davis > > >> > > >> On Fri, Jun 19, 2009 at 8:48 PM, hhsuper wrote: > > >> > Hi, my view return structure like this: > > >> > > > >> > > > >> > > > "key":["1","10075","351"],"value":{"count":27420,"score":2085790,"grade":76.06819839533188} > > >> > > > >> > > > >> > the key column refer to userid, dialogid and seesionid, i know i can > > >> group > > >> > with userid or with userid, dialogid, but how can i group with > > >> > dialogid or dialogid, > > >> > sessionid? > > >> > also about the sorting, the default is using all key, how can i > > sorting > > >> only > > >> > with userid or only with dialogid? > > >> > > > >> > give some suggestion pls. > > >> > > > >> > -- > > >> > Yours sincerely > > >> > > > >> > Jack Su > > >> > > > >> > > > > > > > > > > > > -- > > > Yours sincerely > > > > > > Jack Su > > > > > > > > > -- > Yours sincerely > > Jack Su > --000e0cd2e12c285140046ce71745--