From user-return-5230-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Mon Jun 22 03:13:55 2009 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 62932 invoked from network); 22 Jun 2009 03:13:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Jun 2009 03:13:55 -0000 Received: (qmail 64942 invoked by uid 500); 22 Jun 2009 03:14:05 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 64847 invoked by uid 500); 22 Jun 2009 03:14:04 -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 64837 invoked by uid 99); 22 Jun 2009 03:14:04 -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:14:04 +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: domain of hhsuper@gmail.com designates 209.85.221.171 as permitted sender) Received: from [209.85.221.171] (HELO mail-qy0-f171.google.com) (209.85.221.171) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jun 2009 03:13:56 +0000 Received: by qyk1 with SMTP id 1so3699823qyk.13 for ; Sun, 21 Jun 2009 20:13:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=Pi554VwHtOotlUg/wtZ/VZcbpwb5UN2Akr80P0RVDe4=; b=X7srxMEeZF4L5sT54Irl1tUHt2DJ+HzreL9AQjOfoftcvplhAkCjuRZVLbmDO7/277 u7KJeHr624NrOGbjOKIqcxNwIA0IoKKU77oB8V3anzCCJu/PjJp8pNMvZJbbegyk+054 1ZsrHGzlrDkIKtp7KZhk9KQ1RjMlHEcCYqi8E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=iL1ygX6VrlXlbLirveJ9af9kyWrBtYjxNYnIofEaqmlitmsD8g4UVzd20nLKPPWFX1 VO5nMsqsjDW6L8AmMD/XhtCGYom7/hn6IBTgiCgxIDVminVGBtqSFvslChNjZvGA7uZ2 dtc5CJAwAGR9JovPF668XB1ETI7P19aFcnF50= MIME-Version: 1.0 Received: by 10.224.80.143 with SMTP id t15mr4463351qak.349.1245640415097; Sun, 21 Jun 2009 20:13:35 -0700 (PDT) In-Reply-To: <55047b710906212001i2a0aa70clb6e0d974f47be9fc@mail.gmail.com> References: <69a992ac0906191748q160ac0fct5c26c408da593bbf@mail.gmail.com> <69a992ac0906191802l160d5937qf4b723bffd8c9928@mail.gmail.com> <69a992ac0906201915p5d3073l8af5812ed411d76d@mail.gmail.com> <55047b710906212001i2a0aa70clb6e0d974f47be9fc@mail.gmail.com> From: hhsuper Date: Mon, 22 Jun 2009 11:13:15 +0800 Message-ID: <69a992ac0906212013racf2801tace2a64604f7db0@mail.gmail.com> Subject: Re: view sorting and group question? To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=0015175ce19875b56d046ce742bc X-Virus-Checked: Checked by ClamAV on apache.org --0015175ce19875b56d046ce742bc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Yes, it maybe cost more client resource for request unused data, it something like the move the memory paging/sorting/filting which isn't be recommended from server to the client i guess i don't get the essence when and where to use couchdb, i read mostly couchdb official wiki especially view related, although i can define document and impl some map/reduce views, but i still have many question on how to integrate them to my current application, like above scenairo i want to use couchdb's view(which analyze my users behavior) as a datasource to the web page, i don't know whether it's proper, it seems doen't proper with these many questions encountered. maybe you guys can give some suggestion or some resource you think great On Mon, Jun 22, 2009 at 11:01 AM, Nicholas Orr wrote: > 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 > > > -- Yours sincerely Jack Su --0015175ce19875b56d046ce742bc--