{"action":"created","comment":{"url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/comments/89970712","pull_request_review_id":10496295,"id":89970712,"diff_hunk":"@@ -1,24 +1,23 @@\n [[cardinality]]\n-=== Finding Distinct Counts\n+=== 查找唯一值的数目（Finding Distinct Counts）\n \n-The first approximate aggregation provided by Elasticsearch is the `cardinality`\n-metric.(((\"cardinality\", \"finding distinct counts\")))(((\"aggregations\", \"approximate\", \"cardinality\")))(((\"approximate algorithms\", \"cardinality\")))(((\"distinct counts\")))  This provides the cardinality of a field, also called a _distinct_ or\n-_unique_ count. (((\"unique counts\"))) You may be familiar with the SQL version:\n+Elasticsearch 提供的首个近似聚合是 `cardinality` （注：基数）度量。\n+(((\"cardinality\", \"finding distinct counts\")))(((\"aggregations\", \"approximate\", \"cardinality\")))(((\"approximate algorithms\", \"cardinality\")))(((\"distinct counts\"))) 它提供一个字段的基数，即该字段的 _distinct_ 或者 _unique_ 值的数目。\n+(((\"unique counts\"))) 可能会对 SQL 形式比较熟悉：\n \n [source, sql]\n --------\n SELECT COUNT(DISTINCT color)\n FROM cars\n --------\n \n-Distinct counts are a common operation, and answer many fundamental business questions:\n+Distinct 计数是一个普通的操作，可以回答很多基本的商业问题：","path":"300_Aggregations/60_cardinality.asciidoc","position":19,"original_position":19,"commit_id":"0025f801cd0d674a6df09b4c7664915bed58c5d9","original_commit_id":"62e72cac9f864856f89479d1b76c929dc9577992","user":{"login":"qindongliang","id":7587994,"avatar_url":"https://avatars.githubusercontent.com/u/7587994?v=3","gravatar_id":"","url":"https://api.github.com/users/qindongliang","html_url":"https://github.com/qindongliang","followers_url":"https://api.github.com/users/qindongliang/followers","following_url":"https://api.github.com/users/qindongliang/following{/other_user}","gists_url":"https://api.github.com/users/qindongliang/gists{/gist_id}","starred_url":"https://api.github.com/users/qindongliang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qindongliang/subscriptions","organizations_url":"https://api.github.com/users/qindongliang/orgs","repos_url":"https://api.github.com/users/qindongliang/repos","events_url":"https://api.github.com/users/qindongliang/events{/privacy}","received_events_url":"https://api.github.com/users/qindongliang/received_events","type":"User","site_admin":false},"body":"+Distinct 计数是一个普通的操作\r\n去重是一个很常见的操作","created_at":"2016-11-29T09:34:46Z","updated_at":"2016-11-29T10:00:01Z","html_url":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide/pull/266#discussion_r89970712","pull_request_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/266","_links":{"self":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/comments/89970712"},"html":{"href":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide/pull/266#discussion_r89970712"},"pull_request":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/266"}}},"pull_request":{"url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/266","id":84615903,"html_url":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide/pull/266","diff_url":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide/pull/266.diff","patch_url":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide/pull/266.patch","issue_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/issues/266","number":266,"state":"open","locked":false,"title":"chapter22_part11:/300_Aggregations/60_cardinality.asciidoc","user":{"login":"pengqiuyuan","id":4953205,"avatar_url":"https://avatars.githubusercontent.com/u/4953205?v=3","gravatar_id":"","url":"https://api.github.com/users/pengqiuyuan","html_url":"https://github.com/pengqiuyuan","followers_url":"https://api.github.com/users/pengqiuyuan/followers","following_url":"https://api.github.com/users/pengqiuyuan/following{/other_user}","gists_url":"https://api.github.com/users/pengqiuyuan/gists{/gist_id}","starred_url":"https://api.github.com/users/pengqiuyuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pengqiuyuan/subscriptions","organizations_url":"https://api.github.com/users/pengqiuyuan/orgs","repos_url":"https://api.github.com/users/pengqiuyuan/repos","events_url":"https://api.github.com/users/pengqiuyuan/events{/privacy}","received_events_url":"https://api.github.com/users/pengqiuyuan/received_events","type":"User","site_admin":false},"body":"初译\n","created_at":"2016-09-09T08:58:05Z","updated_at":"2016-11-29T10:00:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a6134361c3d4fb3e3f436ed03d4562e2b4f3b4f4","assignee":{"login":"Lywangwenbin","id":6322372,"avatar_url":"https://avatars.githubusercontent.com/u/6322372?v=3","gravatar_id":"","url":"https://api.github.com/users/Lywangwenbin","html_url":"https://github.com/Lywangwenbin","followers_url":"https://api.github.com/users/Lywangwenbin/followers","following_url":"https://api.github.com/users/Lywangwenbin/following{/other_user}","gists_url":"https://api.github.com/users/Lywangwenbin/gists{/gist_id}","starred_url":"https://api.github.com/users/Lywangwenbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lywangwenbin/subscriptions","organizations_url":"https://api.github.com/users/Lywangwenbin/orgs","repos_url":"https://api.github.com/users/Lywangwenbin/repos","events_url":"https://api.github.com/users/Lywangwenbin/events{/privacy}","received_events_url":"https://api.github.com/users/Lywangwenbin/received_events","type":"User","site_admin":false},"assignees":[{"login":"Lywangwenbin","id":6322372,"avatar_url":"https://avatars.githubusercontent.com/u/6322372?v=3","gravatar_id":"","url":"https://api.github.com/users/Lywangwenbin","html_url":"https://github.com/Lywangwenbin","followers_url":"https://api.github.com/users/Lywangwenbin/followers","following_url":"https://api.github.com/users/Lywangwenbin/following{/other_user}","gists_url":"https://api.github.com/users/Lywangwenbin/gists{/gist_id}","starred_url":"https://api.github.com/users/Lywangwenbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lywangwenbin/subscriptions","organizations_url":"https://api.github.com/users/Lywangwenbin/orgs","repos_url":"https://api.github.com/users/Lywangwenbin/repos","events_url":"https://api.github.com/users/Lywangwenbin/events{/privacy}","received_events_url":"https://api.github.com/users/Lywangwenbin/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/266/commits","review_comments_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/266/comments","review_comment_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/issues/266/comments","statuses_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/statuses/0025f801cd0d674a6df09b4c7664915bed58c5d9","head":{"label":"pengqiuyuan:chapter22_part11","ref":"chapter22_part11","sha":"0025f801cd0d674a6df09b4c7664915bed58c5d9","user":{"login":"pengqiuyuan","id":4953205,"avatar_url":"https://avatars.githubusercontent.com/u/4953205?v=3","gravatar_id":"","url":"https://api.github.com/users/pengqiuyuan","html_url":"https://github.com/pengqiuyuan","followers_url":"https://api.github.com/users/pengqiuyuan/followers","following_url":"https://api.github.com/users/pengqiuyuan/following{/other_user}","gists_url":"https://api.github.com/users/pengqiuyuan/gists{/gist_id}","starred_url":"https://api.github.com/users/pengqiuyuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pengqiuyuan/subscriptions","organizations_url":"https://api.github.com/users/pengqiuyuan/orgs","repos_url":"https://api.github.com/users/pengqiuyuan/repos","events_url":"https://api.github.com/users/pengqiuyuan/events{/privacy}","received_events_url":"https://api.github.com/users/pengqiuyuan/received_events","type":"User","site_admin":false},"repo":{"id":52759810,"name":"elasticsearch-definitive-guide","full_name":"pengqiuyuan/elasticsearch-definitive-guide","owner":{"login":"pengqiuyuan","id":4953205,"avatar_url":"https://avatars.githubusercontent.com/u/4953205?v=3","gravatar_id":"","url":"https://api.github.com/users/pengqiuyuan","html_url":"https://github.com/pengqiuyuan","followers_url":"https://api.github.com/users/pengqiuyuan/followers","following_url":"https://api.github.com/users/pengqiuyuan/following{/other_user}","gists_url":"https://api.github.com/users/pengqiuyuan/gists{/gist_id}","starred_url":"https://api.github.com/users/pengqiuyuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pengqiuyuan/subscriptions","organizations_url":"https://api.github.com/users/pengqiuyuan/orgs","repos_url":"https://api.github.com/users/pengqiuyuan/repos","events_url":"https://api.github.com/users/pengqiuyuan/events{/privacy}","received_events_url":"https://api.github.com/users/pengqiuyuan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pengqiuyuan/elasticsearch-definitive-guide","description":null,"fork":true,"url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide","forks_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/forks","keys_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/teams","hooks_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/hooks","issue_events_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/issues/events{/number}","events_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/events","assignees_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/assignees{/user}","branches_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/branches{/branch}","tags_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/tags","blobs_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/git/refs{/sha}","trees_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/statuses/{sha}","languages_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/languages","stargazers_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/stargazers","contributors_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/contributors","subscribers_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/subscribers","subscription_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/subscription","commits_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/commits{/sha}","git_commits_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/git/commits{/sha}","comments_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/comments{/number}","issue_comment_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/issues/comments{/number}","contents_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/contents/{+path}","compare_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/merges","archive_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/downloads","issues_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/issues{/number}","pulls_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/pulls{/number}","milestones_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/milestones{/number}","notifications_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/labels{/name}","releases_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/releases{/id}","deployments_url":"https://api.github.com/repos/pengqiuyuan/elasticsearch-definitive-guide/deployments","created_at":"2016-02-29T03:02:20Z","updated_at":"2016-02-29T03:02:22Z","pushed_at":"2016-11-28T09:12:16Z","git_url":"git://github.com/pengqiuyuan/elasticsearch-definitive-guide.git","ssh_url":"git@github.com:pengqiuyuan/elasticsearch-definitive-guide.git","clone_url":"https://github.com/pengqiuyuan/elasticsearch-definitive-guide.git","svn_url":"https://github.com/pengqiuyuan/elasticsearch-definitive-guide","homepage":null,"size":7849,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elasticsearch-cn:cn","ref":"cn","sha":"2fa89454e0c7b7b337ad02f0c4968ee2c27a73d8","user":{"login":"elasticsearch-cn","id":2517572,"avatar_url":"https://avatars.githubusercontent.com/u/2517572?v=3","gravatar_id":"","url":"https://api.github.com/users/elasticsearch-cn","html_url":"https://github.com/elasticsearch-cn","followers_url":"https://api.github.com/users/elasticsearch-cn/followers","following_url":"https://api.github.com/users/elasticsearch-cn/following{/other_user}","gists_url":"https://api.github.com/users/elasticsearch-cn/gists{/gist_id}","starred_url":"https://api.github.com/users/elasticsearch-cn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elasticsearch-cn/subscriptions","organizations_url":"https://api.github.com/users/elasticsearch-cn/orgs","repos_url":"https://api.github.com/users/elasticsearch-cn/repos","events_url":"https://api.github.com/users/elasticsearch-cn/events{/privacy}","received_events_url":"https://api.github.com/users/elasticsearch-cn/received_events","type":"Organization","site_admin":false},"repo":{"id":20916742,"name":"elasticsearch-definitive-guide","full_name":"elasticsearch-cn/elasticsearch-definitive-guide","owner":{"login":"elasticsearch-cn","id":2517572,"avatar_url":"https://avatars.githubusercontent.com/u/2517572?v=3","gravatar_id":"","url":"https://api.github.com/users/elasticsearch-cn","html_url":"https://github.com/elasticsearch-cn","followers_url":"https://api.github.com/users/elasticsearch-cn/followers","following_url":"https://api.github.com/users/elasticsearch-cn/following{/other_user}","gists_url":"https://api.github.com/users/elasticsearch-cn/gists{/gist_id}","starred_url":"https://api.github.com/users/elasticsearch-cn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elasticsearch-cn/subscriptions","organizations_url":"https://api.github.com/users/elasticsearch-cn/orgs","repos_url":"https://api.github.com/users/elasticsearch-cn/repos","events_url":"https://api.github.com/users/elasticsearch-cn/events{/privacy}","received_events_url":"https://api.github.com/users/elasticsearch-cn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide","description":"欢迎加QQ群：109764489，贡献力量！","fork":true,"url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide","forks_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/forks","keys_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/teams","hooks_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/hooks","issue_events_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/issues/events{/number}","events_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/events","assignees_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/assignees{/user}","branches_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/branches{/branch}","tags_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/tags","blobs_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/git/refs{/sha}","trees_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/statuses/{sha}","languages_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/languages","stargazers_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/stargazers","contributors_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/contributors","subscribers_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/subscribers","subscription_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/subscription","commits_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/commits{/sha}","git_commits_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/git/commits{/sha}","comments_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/comments{/number}","issue_comment_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/issues/comments{/number}","contents_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/contents/{+path}","compare_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/merges","archive_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/downloads","issues_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/issues{/number}","pulls_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls{/number}","milestones_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/milestones{/number}","notifications_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/labels{/name}","releases_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/releases{/id}","deployments_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/deployments","created_at":"2014-06-17T08:56:29Z","updated_at":"2016-11-26T05:39:28Z","pushed_at":"2016-11-29T09:20:49Z","git_url":"git://github.com/elasticsearch-cn/elasticsearch-definitive-guide.git","ssh_url":"git@github.com:elasticsearch-cn/elasticsearch-definitive-guide.git","clone_url":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide.git","svn_url":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide","homepage":"","size":10035,"stargazers_count":89,"watchers_count":89,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":92,"mirror_url":null,"open_issues_count":138,"forks":92,"open_issues":138,"watchers":89,"default_branch":"cn"}},"_links":{"self":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/266"},"html":{"href":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide/pull/266"},"issue":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/issues/266"},"comments":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/issues/266/comments"},"review_comments":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/266/comments"},"review_comment":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/266/commits"},"statuses":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/statuses/0025f801cd0d674a6df09b4c7664915bed58c5d9"}}}}
{"actor":{"display_login":"qindongliang"}}