{"action":"created","comment":{"url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/comments/84581236","pull_request_review_id":5352819,"id":84581236,"diff_hunk":"@@ -1,44 +1,32 @@\n-[[docvalues-intro]]\n-=== Doc Values Intro\n-\n-Our final topic in this chapter is about an internal aspect of Elasticsearch.\n-While we don't demonstrate any new techniques here, doc values are an\n-important topic that we will refer to repeatedly, and is something that you\n-should be aware of.(((\"docvalues\")))\n-\n-When you sort on a field, Elasticsearch needs access to the value of that\n-field for every document that matches the query.(((\"inverted index\", \"sorting and\")))  The inverted index, which\n-performs very well when searching, is not the ideal structure for sorting on\n-field values:\n-\n-* When searching, we need to be able to map a term to a list of documents.\n-\n-* When sorting, we need to map a document to its terms. In other words, we\n-  need to ``uninvert'' the inverted index.\n-\n-This ``uninverted'' structure is often called a ``column-store'' in other systems.\n-Essentially, it stores all the values for a single field together in a single\n-column of data, which makes it very efficient for operations like sorting.\n-\n-In Elasticsearch, this column-store is known as _doc values_, and is enabled\n-by default. Doc values are created at index-time: when a field is indexed, Elasticsearch\n-adds the tokens to the inverted index for search.  But it also extracts the terms\n-and adds them to the columnar doc values.\n-\n-Doc values are used in several places in Elasticsearch:\n-\n-* Sorting on a field\n-* Aggregations on a field\n-* Certain filters (for example, geolocation filters)\n-* Scripts that refer to fields\n-\n-Because doc values are serialized to disk, we can leverage the OS to help keep\n-access fast.  When the \"working set\" is smaller than the available memory on a node,\n-the OS will naturally keep all the doc values hot in memory, leading to very fast\n-access.  When the \"working set\" is much larger than available memory, the OS will\n-naturally start to page doc-values on/off disk without running into the dreaded\n-OutOfMemory exception.\n-\n-We'll talk about doc values in much greater depth later.  For now, all you need\n-to know is that sorting (and some other operations) happen on a parallel data\n-structure which is built at index-time.\n+[[文档值引言]]\n+=== 文档值引言\n+\n+本章的目的在于介绍关于ElasticSearch内部的一些运行情况。在这里我们先不介绍新的知识点，\n+文档值是我们要经常重复的内容之一，并且是我们应当明确的。(((\"docvalues\")))\n+\n+当你对一个字段进行排序时，ElasticSearch 需要进入每个匹配到的文档得到相关的值。\n+倒排索引在用于搜索时是非常卓越的，但却不是理想的排序结构。\n+\n+* 当搜索的时候，我们需要用检索词去遍历所有的文档。\n+\n+* 当排序的时候，我们需要用文档去匹配检索词。即，我们需要``倒置`` 已经反向的索引。","path":"056_Sorting/95_Docvalues.asciidoc","position":54,"original_position":56,"commit_id":"f0080bc55560e1bf371fa02e1bbb328d34547bd9","original_commit_id":"f0080bc55560e1bf371fa02e1bbb328d34547bd9","user":{"login":"javasgl","id":5222868,"avatar_url":"https://avatars.githubusercontent.com/u/5222868?v=3","gravatar_id":"","url":"https://api.github.com/users/javasgl","html_url":"https://github.com/javasgl","followers_url":"https://api.github.com/users/javasgl/followers","following_url":"https://api.github.com/users/javasgl/following{/other_user}","gists_url":"https://api.github.com/users/javasgl/gists{/gist_id}","starred_url":"https://api.github.com/users/javasgl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javasgl/subscriptions","organizations_url":"https://api.github.com/users/javasgl/orgs","repos_url":"https://api.github.com/users/javasgl/repos","events_url":"https://api.github.com/users/javasgl/events{/privacy}","received_events_url":"https://api.github.com/users/javasgl/received_events","type":"User","site_admin":false},"body":"* 当排序的时候，我们需要一个文档对应的检索词。换句话说，我们需要 `倒置` 倒排索引","created_at":"2016-10-22T17:20:24Z","updated_at":"2016-10-22T17:40:40Z","html_url":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide/pull/198#discussion_r84581236","pull_request_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/198","_links":{"self":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/comments/84581236"},"html":{"href":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide/pull/198#discussion_r84581236"},"pull_request":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/198"}}},"pull_request":{"url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/198","id":82095383,"html_url":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide/pull/198","diff_url":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide/pull/198.diff","patch_url":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide/pull/198.patch","issue_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/issues/198","number":198,"state":"open","locked":false,"title":"chapter8_part4:/056_Sorting/95_Docvalues.asciidoc","user":{"login":"fanyer","id":16081846,"avatar_url":"https://avatars.githubusercontent.com/u/16081846?v=3","gravatar_id":"","url":"https://api.github.com/users/fanyer","html_url":"https://github.com/fanyer","followers_url":"https://api.github.com/users/fanyer/followers","following_url":"https://api.github.com/users/fanyer/following{/other_user}","gists_url":"https://api.github.com/users/fanyer/gists{/gist_id}","starred_url":"https://api.github.com/users/fanyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fanyer/subscriptions","organizations_url":"https://api.github.com/users/fanyer/orgs","repos_url":"https://api.github.com/users/fanyer/repos","events_url":"https://api.github.com/users/fanyer/events{/privacy}","received_events_url":"https://api.github.com/users/fanyer/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-21T02:50:18Z","updated_at":"2016-10-22T17:40:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2f1ef61dd8e9767544e1364b9f732cc3308e504d","assignee":{"login":"javasgl","id":5222868,"avatar_url":"https://avatars.githubusercontent.com/u/5222868?v=3","gravatar_id":"","url":"https://api.github.com/users/javasgl","html_url":"https://github.com/javasgl","followers_url":"https://api.github.com/users/javasgl/followers","following_url":"https://api.github.com/users/javasgl/following{/other_user}","gists_url":"https://api.github.com/users/javasgl/gists{/gist_id}","starred_url":"https://api.github.com/users/javasgl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javasgl/subscriptions","organizations_url":"https://api.github.com/users/javasgl/orgs","repos_url":"https://api.github.com/users/javasgl/repos","events_url":"https://api.github.com/users/javasgl/events{/privacy}","received_events_url":"https://api.github.com/users/javasgl/received_events","type":"User","site_admin":false},"assignees":[{"login":"javasgl","id":5222868,"avatar_url":"https://avatars.githubusercontent.com/u/5222868?v=3","gravatar_id":"","url":"https://api.github.com/users/javasgl","html_url":"https://github.com/javasgl","followers_url":"https://api.github.com/users/javasgl/followers","following_url":"https://api.github.com/users/javasgl/following{/other_user}","gists_url":"https://api.github.com/users/javasgl/gists{/gist_id}","starred_url":"https://api.github.com/users/javasgl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javasgl/subscriptions","organizations_url":"https://api.github.com/users/javasgl/orgs","repos_url":"https://api.github.com/users/javasgl/repos","events_url":"https://api.github.com/users/javasgl/events{/privacy}","received_events_url":"https://api.github.com/users/javasgl/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/198/commits","review_comments_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/198/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/198/comments","statuses_url":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/statuses/f0080bc55560e1bf371fa02e1bbb328d34547bd9","head":{"label":"fanyer:chapter/chapter8_part4","ref":"chapter/chapter8_part4","sha":"f0080bc55560e1bf371fa02e1bbb328d34547bd9","user":{"login":"fanyer","id":16081846,"avatar_url":"https://avatars.githubusercontent.com/u/16081846?v=3","gravatar_id":"","url":"https://api.github.com/users/fanyer","html_url":"https://github.com/fanyer","followers_url":"https://api.github.com/users/fanyer/followers","following_url":"https://api.github.com/users/fanyer/following{/other_user}","gists_url":"https://api.github.com/users/fanyer/gists{/gist_id}","starred_url":"https://api.github.com/users/fanyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fanyer/subscriptions","organizations_url":"https://api.github.com/users/fanyer/orgs","repos_url":"https://api.github.com/users/fanyer/repos","events_url":"https://api.github.com/users/fanyer/events{/privacy}","received_events_url":"https://api.github.com/users/fanyer/received_events","type":"User","site_admin":false},"repo":{"id":63748375,"name":"elasticsearch-definitive-guide","full_name":"fanyer/elasticsearch-definitive-guide","owner":{"login":"fanyer","id":16081846,"avatar_url":"https://avatars.githubusercontent.com/u/16081846?v=3","gravatar_id":"","url":"https://api.github.com/users/fanyer","html_url":"https://github.com/fanyer","followers_url":"https://api.github.com/users/fanyer/followers","following_url":"https://api.github.com/users/fanyer/following{/other_user}","gists_url":"https://api.github.com/users/fanyer/gists{/gist_id}","starred_url":"https://api.github.com/users/fanyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fanyer/subscriptions","organizations_url":"https://api.github.com/users/fanyer/orgs","repos_url":"https://api.github.com/users/fanyer/repos","events_url":"https://api.github.com/users/fanyer/events{/privacy}","received_events_url":"https://api.github.com/users/fanyer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fanyer/elasticsearch-definitive-guide","description":"欢迎加群：109764489，贡献力量！","fork":true,"url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide","forks_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/forks","keys_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/teams","hooks_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/hooks","issue_events_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/issues/events{/number}","events_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/events","assignees_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/assignees{/user}","branches_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/branches{/branch}","tags_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/tags","blobs_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/git/refs{/sha}","trees_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/statuses/{sha}","languages_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/languages","stargazers_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/stargazers","contributors_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/contributors","subscribers_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/subscribers","subscription_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/subscription","commits_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/commits{/sha}","git_commits_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/git/commits{/sha}","comments_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/comments{/number}","issue_comment_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/issues/comments{/number}","contents_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/contents/{+path}","compare_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/merges","archive_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/downloads","issues_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/issues{/number}","pulls_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/pulls{/number}","milestones_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/milestones{/number}","notifications_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/labels{/name}","releases_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/releases{/id}","deployments_url":"https://api.github.com/repos/fanyer/elasticsearch-definitive-guide/deployments","created_at":"2016-07-20T03:48:48Z","updated_at":"2016-07-20T03:48:55Z","pushed_at":"2016-08-15T03:28:59Z","git_url":"git://github.com/fanyer/elasticsearch-definitive-guide.git","ssh_url":"git@github.com:fanyer/elasticsearch-definitive-guide.git","clone_url":"https://github.com/fanyer/elasticsearch-definitive-guide.git","svn_url":"https://github.com/fanyer/elasticsearch-definitive-guide","homepage":"","size":8128,"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":"cn"}},"base":{"label":"elasticsearch-cn:cn","ref":"cn","sha":"c283d6758af22dfe5db416012d9a2d4330daaf0d","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-10-22T06:26:05Z","pushed_at":"2016-10-22T16:19:08Z","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":9316,"stargazers_count":81,"watchers_count":81,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":82,"mirror_url":null,"open_issues_count":239,"forks":82,"open_issues":239,"watchers":81,"default_branch":"cn"}},"_links":{"self":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/198"},"html":{"href":"https://github.com/elasticsearch-cn/elasticsearch-definitive-guide/pull/198"},"issue":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/issues/198"},"comments":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/issues/198/comments"},"review_comments":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/pulls/198/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/198/commits"},"statuses":{"href":"https://api.github.com/repos/elasticsearch-cn/elasticsearch-definitive-guide/statuses/f0080bc55560e1bf371fa02e1bbb328d34547bd9"}}}}
{"actor":{"display_login":"javasgl"}}