couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Fellinger" <m.fellin...@gmail.com>
Subject Calculating most popular tags
Date Fri, 26 Dec 2008 05:39:15 GMT
I have a lot of documents that look like:

{"type": "Jot", "author": "manveru", "tags": ["foo","bar","baz"],
"text": "foobar"}

Now, what I'd like to do is finding out which tags are most used by a
quick query, but it seems that the only place this could ever happen
is in the reduce function... Given the previous discussion of how to
understand reduce I'd like to throw my problem out there as well.
I have following map/reduce right now:

http://p.ramaze.net/16546

And it behaves a lot faster (from ~1.5s to 0.1s) than what I used to have:

http://p.ramaze.net/16547
queried by ?group=true

Yet their results are almost identical, except for the fact that the
prior will return only one result row which contains a list of all
tags with their frequencies, the other one gives a typical group
result, one row per tag, key being the tag and value the frequency.

My question now is, how would you do this different?

I have a couple of other queries that I just can't seem to boil down
to something fast, but I'll get to that another time.

^ manveru

Mime
View raw message