You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by hhsuper <hh...@gmail.com> on 2009/06/20 02:48:59 UTC

view sorting and group question?

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

Re: view sorting and group question?

Posted by Brian Candler <B....@pobox.com>.
On Sun, Jun 21, 2009 at 10:15:31AM +0800, 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?

That's one way.

Another way is a single large view where you label each ordering of keys:

function(doc) {
  emit(["by_foo", doc.foo||null, doc.bar||null, doc.baz||null]);
  emit(["by_bar", doc.bar||null, doc.baz||null, doc.foo||null]);
  emit(["by_baz", doc.baz||null, doc.foo||null, doc.bar||null]);
}

Then your client can query
   startkey=["by_foo"]&endkey=["by_foo",{}]

where the by_foo can be chosen dynamically based on a parameter when
fetching the web page. This may or may not simplify your code, and this one
view might be larger than three separate views.

Brian.

RE: view sorting and group question?

Posted by Nils Breunese <N....@vpro.nl>.
ExtJS is not the only approach. There is a DataTable control for YUI, and the DataTables plugin for jQuery for instance. I've used the jQuery plugin myself and it was pretty easy.

Nils Breunese.

________________________________________
Van: Nicholas Orr [nicholas.orr@zxgen.net]
Verzonden: maandag 22 juni 2009 5:01
Aan: user@couchdb.apache.org
Onderwerp: Re: view sorting and group question?

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

De informatie vervat in deze  e-mail en meegezonden bijlagen is uitsluitend bedoeld voor gebruik door de geadresseerde en kan vertrouwelijke informatie bevatten. Openbaarmaking, vermenigvuldiging, verspreiding en/of verstrekking van deze informatie aan derden is voorbehouden aan geadresseerde. De VPRO staat niet in voor de juiste en volledige overbrenging van de inhoud van een verzonden e-mail, noch voor tijdige ontvangst daarvan.

Re: view sorting and group question?

Posted by hhsuper <hh...@gmail.com>.
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 <ni...@zxgen.net>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 <hh...@gmail.com> 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 <paul.joseph.davis@gmail.com
> > >wrote:
> >
> > > On Fri, Jun 19, 2009 at 9:02 PM, hhsuper<hh...@gmail.com> 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<hh...@gmail.com> 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

Re: view sorting and group question?

Posted by Nicholas Orr <ni...@zxgen.net>.
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 <hh...@gmail.com> 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 <paul.joseph.davis@gmail.com
> >wrote:
>
> > On Fri, Jun 19, 2009 at 9:02 PM, hhsuper<hh...@gmail.com> 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<hh...@gmail.com> 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
>

Re: view sorting and group question?

Posted by Dmitry Unkovsky <oi...@gmail.com>.
As for me, I see couchdb as a persistent layer for any ajax app.
Though show functions allow pages to be exposed as server-side pages,
for basic usage like search engines or simple handhelds, features like
sorting and different ui niceties I leave for a clientside javascript,
which additionally takes load from server and adds responsiveness to
user experience.
Of course it's just one of many possible usages, but i find this
approach very convenient to me.

> On Sun, Jun 21, 2009 at 10:09 PM, hhsuper<hh...@gmail.com> wrote:
>> should i say that couchdb isn't for such usage? or i doesn't get the essence
>> or couchdb doesn't impl this feature yet?
>>
>
> I would say that you just need to read more on the examples for
> CouchDB. It may do things differently than you might expect at first,
> but once you figure out what's going on it should make perfect sense
> on why things are the way they are.

Re: view sorting and group question?

Posted by Paul Davis <pa...@gmail.com>.
On Sun, Jun 21, 2009 at 10:09 PM, hhsuper<hh...@gmail.com> wrote:
> should i say that couchdb isn't for such usage? or i doesn't get the essence
> or couchdb doesn't impl this feature yet?
>

I would say that you just need to read more on the examples for
CouchDB. It may do things differently than you might expect at first,
but once you figure out what's going on it should make perfect sense
on why things are the way they are.

Paul Davis

> On Sun, Jun 21, 2009 at 10:24 AM, Paul Davis <pa...@gmail.com>wrote:
>
>> If you're trying to do something like a table that has sortable
>> columns, then yes, you're going to have to use multiple views for that
>> page.
>>
>> On Sat, Jun 20, 2009 at 10:15 PM, hhsuper<hh...@gmail.com> 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 <paul.joseph.davis@gmail.com
>> >wrote:
>> >
>> >> On Fri, Jun 19, 2009 at 9:02 PM, hhsuper<hh...@gmail.com> 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<hh...@gmail.com> 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
>

Re: view sorting and group question?

Posted by hhsuper <hh...@gmail.com>.
should i say that couchdb isn't for such usage? or i doesn't get the essence
or couchdb doesn't impl this feature yet?

On Sun, Jun 21, 2009 at 10:24 AM, Paul Davis <pa...@gmail.com>wrote:

> If you're trying to do something like a table that has sortable
> columns, then yes, you're going to have to use multiple views for that
> page.
>
> On Sat, Jun 20, 2009 at 10:15 PM, hhsuper<hh...@gmail.com> 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 <paul.joseph.davis@gmail.com
> >wrote:
> >
> >> On Fri, Jun 19, 2009 at 9:02 PM, hhsuper<hh...@gmail.com> 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<hh...@gmail.com> 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

Re: view sorting and group question?

Posted by Paul Davis <pa...@gmail.com>.
If you're trying to do something like a table that has sortable
columns, then yes, you're going to have to use multiple views for that
page.

On Sat, Jun 20, 2009 at 10:15 PM, hhsuper<hh...@gmail.com> 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 <pa...@gmail.com>wrote:
>
>> On Fri, Jun 19, 2009 at 9:02 PM, hhsuper<hh...@gmail.com> 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<hh...@gmail.com> 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
>

Re: view sorting and group question?

Posted by hhsuper <hh...@gmail.com>.
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 <pa...@gmail.com>wrote:

> On Fri, Jun 19, 2009 at 9:02 PM, hhsuper<hh...@gmail.com> 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<hh...@gmail.com> 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

Re: view sorting and group question?

Posted by Paul Davis <pa...@gmail.com>.
On Fri, Jun 19, 2009 at 9:02 PM, hhsuper<hh...@gmail.com> 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 <pa...@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<hh...@gmail.com> 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
>

Re: view sorting and group question?

Posted by hhsuper <hh...@gmail.com>.
I mean could i sorting with any one of my keys? not with all keys, could i
do this in couchdb view

i use couchdb first time in my project, thank you guys for help

On Sat, Jun 20, 2009 at 9:02 AM, hhsuper <hh...@gmail.com> wrote:

> thanks paul,
>
> do you mean i need another view to resolve this, the difference between
> them are the key order?
>
> 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 <pa...@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<hh...@gmail.com> 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

Re: view sorting and group question?

Posted by hhsuper <hh...@gmail.com>.
thanks paul,

do you mean i need another view to resolve this, the difference between them
are the key order?

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 <pa...@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<hh...@gmail.com> 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

Re: view sorting and group question?

Posted by Paul Davis <pa...@gmail.com>.
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<hh...@gmail.com> 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
>