{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/110183103","pull_request_review_id":31336753,"id":110183103,"diff_hunk":"@@ -0,0 +1,43 @@\n+{\n+  \"field_caps\": {\n+    \"documentation\": \"http://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html\",\n+    \"methods\": [\"GET\", \"POST\"],\n+    \"url\": {\n+      \"path\": \"/_field_caps\",\n+      \"paths\": [\n+        \"/_field_caps\",\n+        \"/{index}/_field_caps\"\n+      ],\n+      \"parts\": {\n+        \"index\": {\n+          \"type\" : \"list\",\n+          \"description\" : \"A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices\"\n+        }\n+      },\n+      \"params\": {\n+        \"fields\": {","path":"rest-api-spec/src/main/resources/rest-api-spec/api/field_caps.json","position":18,"original_position":18,"commit_id":"1c1c0267cd3c82fa406a120e22a3b80944f415ac","original_commit_id":"1c1c0267cd3c82fa406a120e22a3b80944f415ac","user":{"login":"jimczi","id":15977469,"avatar_url":"https://avatars3.githubusercontent.com/u/15977469?v=3","gravatar_id":"","url":"https://api.github.com/users/jimczi","html_url":"https://github.com/jimczi","followers_url":"https://api.github.com/users/jimczi/followers","following_url":"https://api.github.com/users/jimczi/following{/other_user}","gists_url":"https://api.github.com/users/jimczi/gists{/gist_id}","starred_url":"https://api.github.com/users/jimczi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimczi/subscriptions","organizations_url":"https://api.github.com/users/jimczi/orgs","repos_url":"https://api.github.com/users/jimczi/repos","events_url":"https://api.github.com/users/jimczi/events{/privacy}","received_events_url":"https://api.github.com/users/jimczi/received_events","type":"User","site_admin":false},"body":"It's not required because you can use the body of the request to set the fields to retrieve.\r\nSee the body section at the end of the spec. ","created_at":"2017-04-06T14:53:07Z","updated_at":"2017-04-06T14:53:07Z","html_url":"https://github.com/elastic/elasticsearch/pull/23007#discussion_r110183103","pull_request_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/23007","_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/110183103"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/23007#discussion_r110183103"},"pull_request":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/23007"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/23007","id":104897378,"html_url":"https://github.com/elastic/elasticsearch/pull/23007","diff_url":"https://github.com/elastic/elasticsearch/pull/23007.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/23007.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/23007","number":23007,"state":"closed","locked":false,"title":"Add FieldCapabilities (_field_caps) API","user":{"login":"jimczi","id":15977469,"avatar_url":"https://avatars3.githubusercontent.com/u/15977469?v=3","gravatar_id":"","url":"https://api.github.com/users/jimczi","html_url":"https://github.com/jimczi","followers_url":"https://api.github.com/users/jimczi/followers","following_url":"https://api.github.com/users/jimczi/following{/other_user}","gists_url":"https://api.github.com/users/jimczi/gists{/gist_id}","starred_url":"https://api.github.com/users/jimczi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimczi/subscriptions","organizations_url":"https://api.github.com/users/jimczi/orgs","repos_url":"https://api.github.com/users/jimczi/repos","events_url":"https://api.github.com/users/jimczi/events{/privacy}","received_events_url":"https://api.github.com/users/jimczi/received_events","type":"User","site_admin":false},"body":"This change introduces a new API called `_field_caps` that allows to retrieve the capabilities of specific fields.\r\nThis field centric API relies solely on the mapping of the requested indices to extract the following infos:\r\n* `types`: one or many field types if the type is not the same across the requested indices\r\n* `searchable`: Whether this field is indexed for search on at least one requested indices.\r\n* `aggregatable`:  Whether this field can be aggregated on at least one requested indices.\r\n\r\nExample:\r\n\r\n````\r\nGET t,v/_field_caps?fields=field1,field2,field3\r\n````\r\n\r\nreturns:\r\n\r\n````\r\n{\r\n   \"fields\": {\r\n      \"field1\": {\r\n         \"_all\": {\r\n            \"types\": \"text\",\r\n            \"searchable\": true,\r\n            \"aggregatable\": false\r\n         }\r\n      },\r\n      \"field3\": {\r\n         \"_all\": {\r\n            \"types\": \"text\",\r\n            \"searchable\": true,\r\n            \"aggregatable\": false\r\n         }\r\n      },\r\n      \"field2\": {\r\n         \"_all\": {\r\n            \"types\": [\r\n               \"keyword\",\r\n               \"long\"\r\n            ],\r\n            \"searchable\": true,\r\n            \"aggregatable\": true\r\n         }\r\n      }\r\n   }\r\n}\r\n````\r\n\r\nIn this example `field1` and `field3` have the same type `text` across the requested indices `t` and `v`.\r\nConversely `field2` is defined with two conflicting types `keyword` and `long`.\r\nNote that `_field_caps` does not treat this case as an error but rather return the list of unique types seen for this field.\r\n\r\nIt is also possible to get a view of each index field capabilities with the `level` parameter:\r\n\r\n````\r\nGET t,v/_field_caps?fields=field2&level=indices\r\n````\r\n\r\n````\r\n{\r\n   \"fields\": {\r\n      \"field2\": {\r\n         \"t\": {\r\n            \"types\": \"keyword\",\r\n            \"searchable\": true,\r\n            \"aggregatable\": true\r\n         },\r\n         \"v\": {\r\n            \"types\": \"long\",\r\n            \"searchable\": true,\r\n            \"aggregatable\": true\r\n         }\r\n      }\r\n   }\r\n}\r\n````\r\n\r\nCloses https://github.com/elastic/elasticsearch/issues/22438#issuecomment-276459451","created_at":"2017-02-06T22:33:58Z","updated_at":"2017-04-06T14:53:07Z","closed_at":"2017-03-31T13:34:46Z","merged_at":"2017-03-31T13:34:46Z","merge_commit_sha":"a8250b26e7902cf81e0b3f3e39d3850116d6d921","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/23007/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/23007/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/23007/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/1c1c0267cd3c82fa406a120e22a3b80944f415ac","head":{"label":"jimczi:field_caps","ref":"field_caps","sha":"1c1c0267cd3c82fa406a120e22a3b80944f415ac","user":{"login":"jimczi","id":15977469,"avatar_url":"https://avatars3.githubusercontent.com/u/15977469?v=3","gravatar_id":"","url":"https://api.github.com/users/jimczi","html_url":"https://github.com/jimczi","followers_url":"https://api.github.com/users/jimczi/followers","following_url":"https://api.github.com/users/jimczi/following{/other_user}","gists_url":"https://api.github.com/users/jimczi/gists{/gist_id}","starred_url":"https://api.github.com/users/jimczi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimczi/subscriptions","organizations_url":"https://api.github.com/users/jimczi/orgs","repos_url":"https://api.github.com/users/jimczi/repos","events_url":"https://api.github.com/users/jimczi/events{/privacy}","received_events_url":"https://api.github.com/users/jimczi/received_events","type":"User","site_admin":false},"repo":{"id":46779835,"name":"elasticsearch","full_name":"jimczi/elasticsearch","owner":{"login":"jimczi","id":15977469,"avatar_url":"https://avatars3.githubusercontent.com/u/15977469?v=3","gravatar_id":"","url":"https://api.github.com/users/jimczi","html_url":"https://github.com/jimczi","followers_url":"https://api.github.com/users/jimczi/followers","following_url":"https://api.github.com/users/jimczi/following{/other_user}","gists_url":"https://api.github.com/users/jimczi/gists{/gist_id}","starred_url":"https://api.github.com/users/jimczi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimczi/subscriptions","organizations_url":"https://api.github.com/users/jimczi/orgs","repos_url":"https://api.github.com/users/jimczi/repos","events_url":"https://api.github.com/users/jimczi/events{/privacy}","received_events_url":"https://api.github.com/users/jimczi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jimczi/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/jimczi/elasticsearch","forks_url":"https://api.github.com/repos/jimczi/elasticsearch/forks","keys_url":"https://api.github.com/repos/jimczi/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jimczi/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jimczi/elasticsearch/teams","hooks_url":"https://api.github.com/repos/jimczi/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/jimczi/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/jimczi/elasticsearch/events","assignees_url":"https://api.github.com/repos/jimczi/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/jimczi/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/jimczi/elasticsearch/tags","blobs_url":"https://api.github.com/repos/jimczi/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jimczi/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jimczi/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/jimczi/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jimczi/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/jimczi/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/jimczi/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/jimczi/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/jimczi/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/jimczi/elasticsearch/subscription","commits_url":"https://api.github.com/repos/jimczi/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/jimczi/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/jimczi/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/jimczi/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/jimczi/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/jimczi/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jimczi/elasticsearch/merges","archive_url":"https://api.github.com/repos/jimczi/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jimczi/elasticsearch/downloads","issues_url":"https://api.github.com/repos/jimczi/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/jimczi/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/jimczi/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/jimczi/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jimczi/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/jimczi/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/jimczi/elasticsearch/deployments","created_at":"2015-11-24T09:08:46Z","updated_at":"2016-01-11T09:19:57Z","pushed_at":"2017-04-06T07:47:23Z","git_url":"git://github.com/jimczi/elasticsearch.git","ssh_url":"git@github.com:jimczi/elasticsearch.git","clone_url":"https://github.com/jimczi/elasticsearch.git","svn_url":"https://github.com/jimczi/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":280837,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":"elastic:master","ref":"master","sha":"72824609dfb025c9739f6b5966815b9018efb9f4","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars3.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":507775,"name":"elasticsearch","full_name":"elastic/elasticsearch","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars3.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":false,"url":"https://api.github.com/repos/elastic/elasticsearch","forks_url":"https://api.github.com/repos/elastic/elasticsearch/forks","keys_url":"https://api.github.com/repos/elastic/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/elasticsearch/teams","hooks_url":"https://api.github.com/repos/elastic/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/elasticsearch/events","assignees_url":"https://api.github.com/repos/elastic/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/elasticsearch/tags","blobs_url":"https://api.github.com/repos/elastic/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/elastic/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/elastic/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/elastic/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/elastic/elasticsearch/subscription","commits_url":"https://api.github.com/repos/elastic/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/elasticsearch/merges","archive_url":"https://api.github.com/repos/elastic/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/elasticsearch/downloads","issues_url":"https://api.github.com/repos/elastic/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/elastic/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/elasticsearch/deployments","created_at":"2010-02-08T13:20:56Z","updated_at":"2017-04-06T13:51:14Z","pushed_at":"2017-04-06T13:34:47Z","git_url":"git://github.com/elastic/elasticsearch.git","ssh_url":"git@github.com:elastic/elasticsearch.git","clone_url":"https://github.com/elastic/elasticsearch.git","svn_url":"https://github.com/elastic/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":333484,"stargazers_count":21858,"watchers_count":21858,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7259,"mirror_url":null,"open_issues_count":1337,"forks":7259,"open_issues":1337,"watchers":21858,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/23007"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/23007"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/23007"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/23007/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/23007/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/23007/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/1c1c0267cd3c82fa406a120e22a3b80944f415ac"}}}}
{"actor":{"display_login":"jimczi"}}