From 87475220bc19f6b0355d7987caa0e96e7591a95b Mon Sep 17 00:00:00 2001 From: Alan Bernstein Date: Tue, 30 May 2017 11:35:01 -0500 Subject: [PATCH 1/2] Document inverse=true for TopN --- docs/query-language.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/query-language.md b/docs/query-language.md index f35b88ad3..24c9b2567 100644 --- a/docs/query-language.md +++ b/docs/query-language.md @@ -326,12 +326,13 @@ Return `2` ``` TopN([BITMAP_CALL], , [n=UINT], - [, ]) + [inverse=true], [, ]) ``` **Description:** Return the id and count of the top `n` bitmaps (by count of bits) in the frame. +`inverse=true` specifies that the call should operate on the [inverse view ](../data-model/#inverse). The `field` and `filters` arguments work together to only return Bitmaps which have the attribute specified by `field` with one of the values specified in `filters`. @@ -346,10 +347,20 @@ TopN(frame="stargazer") Returns `[{"key": 1, "count": 2}, {"key": 2, "count": 2}, {"key": 3, "count": 1}]` -* key is a user +* key is a user ID * count is amount of repositories * Results are the number of repositories that each user starred in descending order for all users in the stargazer frame, for example user 1 starred two repositories, user 2 starred two repositories, user 3 starred one repository. +``` +TopN(frame="stargazer", inverse=true) +``` + +Returns `[{"key": 1, "count": 2}, {"key": 2, "count": 2}, {"key": 3, "count": 1}]` + +* key is a repository ID +* count is amount of users +* Results are the number of user that starred each repository in descending order for all respositories in the stargazer frame. + ``` TopN(frame="stargazer", n=2) ``` From 7aeca13085ab917a15e5e164578c2e033d80a1bf Mon Sep 17 00:00:00 2001 From: Alan Bernstein Date: Thu, 1 Jun 2017 11:10:33 -0500 Subject: [PATCH 2/2] Fix typo --- docs/query-language.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/query-language.md b/docs/query-language.md index 24c9b2567..1d0e01ac4 100644 --- a/docs/query-language.md +++ b/docs/query-language.md @@ -359,7 +359,7 @@ Returns `[{"key": 1, "count": 2}, {"key": 2, "count": 2}, {"key": 3, "count": 1} * key is a repository ID * count is amount of users -* Results are the number of user that starred each repository in descending order for all respositories in the stargazer frame. +* Results are the number of users that starred each repository in descending order for all respositories in the stargazer frame. ``` TopN(frame="stargazer", n=2)