{"action":"created","comment":{"url":"https://api.github.com/repos/kuzzleio/kuzzle/pulls/comments/87984979","pull_request_review_id":8572228,"id":87984979,"diff_hunk":"@@ -285,12 +294,24 @@ function ElasticSearch(kuzzle, options, config) {\n    */\n   this.create = function elasticsearchCreate (requestObject) {\n     var\n-      data = cleanData.call(this, requestObject);\n+      data = cleanData(requestObject);\n \n     if (data.body._routing) {\n       Promise.reject(new BadRequestError('Kuzzle does not support \"_routing\" in create action.'));\n     }\n \n+    if (data.hasOwnProperty('refresh')) {\n+      if (compareVersions(this.esVersion.number, '5.0.0') < 0) {\n+        Promise.reject(new BadRequestError(`Refresh parameter is not supported by the version \"${this.esVersion.number}\" of Elasticsearch`));\n+      }\n+      if (compareVersions(config.apiVersion, '5.0') < 0) {\n+        Promise.reject(new BadRequestError(`Refresh parameter is not supported by the version \"${config.apiVersion}\" of Elasticsearch API`));\n+      }\n+      if (data.refresh !== 'wait_for' && data.refresh !== 'false' && data.refresh !== false) {\n+        Promise.reject(new BadRequestError('Refresh parameter only supports the value \"wait_for\" or false'));","path":"lib/services/elasticsearch.js","position":91,"original_position":91,"commit_id":"355b185f954dfab1e60bde9151328d6c16da0298","original_commit_id":"355b185f954dfab1e60bde9151328d6c16da0298","user":{"login":"stafyniaksacha","id":3911343,"avatar_url":"https://avatars.githubusercontent.com/u/3911343?v=3","gravatar_id":"","url":"https://api.github.com/users/stafyniaksacha","html_url":"https://github.com/stafyniaksacha","followers_url":"https://api.github.com/users/stafyniaksacha/followers","following_url":"https://api.github.com/users/stafyniaksacha/following{/other_user}","gists_url":"https://api.github.com/users/stafyniaksacha/gists{/gist_id}","starred_url":"https://api.github.com/users/stafyniaksacha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stafyniaksacha/subscriptions","organizations_url":"https://api.github.com/users/stafyniaksacha/orgs","repos_url":"https://api.github.com/users/stafyniaksacha/repos","events_url":"https://api.github.com/users/stafyniaksacha/events{/privacy}","received_events_url":"https://api.github.com/users/stafyniaksacha/received_events","type":"User","site_admin":false},"body":":+1:","created_at":"2016-11-15T10:12:46Z","updated_at":"2016-11-15T10:12:46Z","html_url":"https://github.com/kuzzleio/kuzzle/pull/534#discussion_r87984979","pull_request_url":"https://api.github.com/repos/kuzzleio/kuzzle/pulls/534","_links":{"self":{"href":"https://api.github.com/repos/kuzzleio/kuzzle/pulls/comments/87984979"},"html":{"href":"https://github.com/kuzzleio/kuzzle/pull/534#discussion_r87984979"},"pull_request":{"href":"https://api.github.com/repos/kuzzleio/kuzzle/pulls/534"}}},"pull_request":{"url":"https://api.github.com/repos/kuzzleio/kuzzle/pulls/534","id":93583630,"html_url":"https://github.com/kuzzleio/kuzzle/pull/534","diff_url":"https://github.com/kuzzleio/kuzzle/pull/534.diff","patch_url":"https://github.com/kuzzleio/kuzzle/pull/534.patch","issue_url":"https://api.github.com/repos/kuzzleio/kuzzle/issues/534","number":534,"state":"open","locked":false,"title":"Feature 532 : Allow the usage of request=wait_for","user":{"login":"dbengsch","id":16542512,"avatar_url":"https://avatars.githubusercontent.com/u/16542512?v=3","gravatar_id":"","url":"https://api.github.com/users/dbengsch","html_url":"https://github.com/dbengsch","followers_url":"https://api.github.com/users/dbengsch/followers","following_url":"https://api.github.com/users/dbengsch/following{/other_user}","gists_url":"https://api.github.com/users/dbengsch/gists{/gist_id}","starred_url":"https://api.github.com/users/dbengsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbengsch/subscriptions","organizations_url":"https://api.github.com/users/dbengsch/orgs","repos_url":"https://api.github.com/users/dbengsch/repos","events_url":"https://api.github.com/users/dbengsch/events{/privacy}","received_events_url":"https://api.github.com/users/dbengsch/received_events","type":"User","site_admin":false},"body":"fix #532\r\n\r\n:warning: Must be merged after kuzzleio/kuzzle-common-objects#7 produces a new npm package. Travis should be re-run after this merge as the package is not available for the moment. :warning:\r\n:warning: Must be merged after PR #529. :warning:","created_at":"2016-11-14T15:11:17Z","updated_at":"2016-11-15T10:12:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1ccc96257575a9080fd6c9842776588d613cb1e2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/kuzzleio/kuzzle/pulls/534/commits","review_comments_url":"https://api.github.com/repos/kuzzleio/kuzzle/pulls/534/comments","review_comment_url":"https://api.github.com/repos/kuzzleio/kuzzle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kuzzleio/kuzzle/issues/534/comments","statuses_url":"https://api.github.com/repos/kuzzleio/kuzzle/statuses/355b185f954dfab1e60bde9151328d6c16da0298","head":{"label":"kuzzleio:feature-532-refresh-wait-for","ref":"feature-532-refresh-wait-for","sha":"355b185f954dfab1e60bde9151328d6c16da0298","user":{"login":"kuzzleio","id":12933347,"avatar_url":"https://avatars.githubusercontent.com/u/12933347?v=3","gravatar_id":"","url":"https://api.github.com/users/kuzzleio","html_url":"https://github.com/kuzzleio","followers_url":"https://api.github.com/users/kuzzleio/followers","following_url":"https://api.github.com/users/kuzzleio/following{/other_user}","gists_url":"https://api.github.com/users/kuzzleio/gists{/gist_id}","starred_url":"https://api.github.com/users/kuzzleio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuzzleio/subscriptions","organizations_url":"https://api.github.com/users/kuzzleio/orgs","repos_url":"https://api.github.com/users/kuzzleio/repos","events_url":"https://api.github.com/users/kuzzleio/events{/privacy}","received_events_url":"https://api.github.com/users/kuzzleio/received_events","type":"Organization","site_admin":false},"repo":{"id":41084349,"name":"kuzzle","full_name":"kuzzleio/kuzzle","owner":{"login":"kuzzleio","id":12933347,"avatar_url":"https://avatars.githubusercontent.com/u/12933347?v=3","gravatar_id":"","url":"https://api.github.com/users/kuzzleio","html_url":"https://github.com/kuzzleio","followers_url":"https://api.github.com/users/kuzzleio/followers","following_url":"https://api.github.com/users/kuzzleio/following{/other_user}","gists_url":"https://api.github.com/users/kuzzleio/gists{/gist_id}","starred_url":"https://api.github.com/users/kuzzleio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuzzleio/subscriptions","organizations_url":"https://api.github.com/users/kuzzleio/orgs","repos_url":"https://api.github.com/users/kuzzleio/repos","events_url":"https://api.github.com/users/kuzzleio/events{/privacy}","received_events_url":"https://api.github.com/users/kuzzleio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kuzzleio/kuzzle","description":"Open-source Back-end, self-hostable & ready to use - Real-time, storage, advanced search - Web, Apps, Mobile, IoT -","fork":false,"url":"https://api.github.com/repos/kuzzleio/kuzzle","forks_url":"https://api.github.com/repos/kuzzleio/kuzzle/forks","keys_url":"https://api.github.com/repos/kuzzleio/kuzzle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kuzzleio/kuzzle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kuzzleio/kuzzle/teams","hooks_url":"https://api.github.com/repos/kuzzleio/kuzzle/hooks","issue_events_url":"https://api.github.com/repos/kuzzleio/kuzzle/issues/events{/number}","events_url":"https://api.github.com/repos/kuzzleio/kuzzle/events","assignees_url":"https://api.github.com/repos/kuzzleio/kuzzle/assignees{/user}","branches_url":"https://api.github.com/repos/kuzzleio/kuzzle/branches{/branch}","tags_url":"https://api.github.com/repos/kuzzleio/kuzzle/tags","blobs_url":"https://api.github.com/repos/kuzzleio/kuzzle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kuzzleio/kuzzle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kuzzleio/kuzzle/git/refs{/sha}","trees_url":"https://api.github.com/repos/kuzzleio/kuzzle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kuzzleio/kuzzle/statuses/{sha}","languages_url":"https://api.github.com/repos/kuzzleio/kuzzle/languages","stargazers_url":"https://api.github.com/repos/kuzzleio/kuzzle/stargazers","contributors_url":"https://api.github.com/repos/kuzzleio/kuzzle/contributors","subscribers_url":"https://api.github.com/repos/kuzzleio/kuzzle/subscribers","subscription_url":"https://api.github.com/repos/kuzzleio/kuzzle/subscription","commits_url":"https://api.github.com/repos/kuzzleio/kuzzle/commits{/sha}","git_commits_url":"https://api.github.com/repos/kuzzleio/kuzzle/git/commits{/sha}","comments_url":"https://api.github.com/repos/kuzzleio/kuzzle/comments{/number}","issue_comment_url":"https://api.github.com/repos/kuzzleio/kuzzle/issues/comments{/number}","contents_url":"https://api.github.com/repos/kuzzleio/kuzzle/contents/{+path}","compare_url":"https://api.github.com/repos/kuzzleio/kuzzle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kuzzleio/kuzzle/merges","archive_url":"https://api.github.com/repos/kuzzleio/kuzzle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kuzzleio/kuzzle/downloads","issues_url":"https://api.github.com/repos/kuzzleio/kuzzle/issues{/number}","pulls_url":"https://api.github.com/repos/kuzzleio/kuzzle/pulls{/number}","milestones_url":"https://api.github.com/repos/kuzzleio/kuzzle/milestones{/number}","notifications_url":"https://api.github.com/repos/kuzzleio/kuzzle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kuzzleio/kuzzle/labels{/name}","releases_url":"https://api.github.com/repos/kuzzleio/kuzzle/releases{/id}","deployments_url":"https://api.github.com/repos/kuzzleio/kuzzle/deployments","created_at":"2015-08-20T08:26:57Z","updated_at":"2016-11-15T07:39:53Z","pushed_at":"2016-11-15T10:06:15Z","git_url":"git://github.com/kuzzleio/kuzzle.git","ssh_url":"git@github.com:kuzzleio/kuzzle.git","clone_url":"https://github.com/kuzzleio/kuzzle.git","svn_url":"https://github.com/kuzzleio/kuzzle","homepage":"http://kuzzle.io","size":9177,"stargazers_count":355,"watchers_count":355,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":57,"forks":21,"open_issues":57,"watchers":355,"default_branch":"master"}},"base":{"label":"kuzzleio:develop","ref":"develop","sha":"8122f7dd5dcf0a22937159fa0077b72b4c4e1585","user":{"login":"kuzzleio","id":12933347,"avatar_url":"https://avatars.githubusercontent.com/u/12933347?v=3","gravatar_id":"","url":"https://api.github.com/users/kuzzleio","html_url":"https://github.com/kuzzleio","followers_url":"https://api.github.com/users/kuzzleio/followers","following_url":"https://api.github.com/users/kuzzleio/following{/other_user}","gists_url":"https://api.github.com/users/kuzzleio/gists{/gist_id}","starred_url":"https://api.github.com/users/kuzzleio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuzzleio/subscriptions","organizations_url":"https://api.github.com/users/kuzzleio/orgs","repos_url":"https://api.github.com/users/kuzzleio/repos","events_url":"https://api.github.com/users/kuzzleio/events{/privacy}","received_events_url":"https://api.github.com/users/kuzzleio/received_events","type":"Organization","site_admin":false},"repo":{"id":41084349,"name":"kuzzle","full_name":"kuzzleio/kuzzle","owner":{"login":"kuzzleio","id":12933347,"avatar_url":"https://avatars.githubusercontent.com/u/12933347?v=3","gravatar_id":"","url":"https://api.github.com/users/kuzzleio","html_url":"https://github.com/kuzzleio","followers_url":"https://api.github.com/users/kuzzleio/followers","following_url":"https://api.github.com/users/kuzzleio/following{/other_user}","gists_url":"https://api.github.com/users/kuzzleio/gists{/gist_id}","starred_url":"https://api.github.com/users/kuzzleio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuzzleio/subscriptions","organizations_url":"https://api.github.com/users/kuzzleio/orgs","repos_url":"https://api.github.com/users/kuzzleio/repos","events_url":"https://api.github.com/users/kuzzleio/events{/privacy}","received_events_url":"https://api.github.com/users/kuzzleio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kuzzleio/kuzzle","description":"Open-source Back-end, self-hostable & ready to use - Real-time, storage, advanced search - Web, Apps, Mobile, IoT -","fork":false,"url":"https://api.github.com/repos/kuzzleio/kuzzle","forks_url":"https://api.github.com/repos/kuzzleio/kuzzle/forks","keys_url":"https://api.github.com/repos/kuzzleio/kuzzle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kuzzleio/kuzzle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kuzzleio/kuzzle/teams","hooks_url":"https://api.github.com/repos/kuzzleio/kuzzle/hooks","issue_events_url":"https://api.github.com/repos/kuzzleio/kuzzle/issues/events{/number}","events_url":"https://api.github.com/repos/kuzzleio/kuzzle/events","assignees_url":"https://api.github.com/repos/kuzzleio/kuzzle/assignees{/user}","branches_url":"https://api.github.com/repos/kuzzleio/kuzzle/branches{/branch}","tags_url":"https://api.github.com/repos/kuzzleio/kuzzle/tags","blobs_url":"https://api.github.com/repos/kuzzleio/kuzzle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kuzzleio/kuzzle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kuzzleio/kuzzle/git/refs{/sha}","trees_url":"https://api.github.com/repos/kuzzleio/kuzzle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kuzzleio/kuzzle/statuses/{sha}","languages_url":"https://api.github.com/repos/kuzzleio/kuzzle/languages","stargazers_url":"https://api.github.com/repos/kuzzleio/kuzzle/stargazers","contributors_url":"https://api.github.com/repos/kuzzleio/kuzzle/contributors","subscribers_url":"https://api.github.com/repos/kuzzleio/kuzzle/subscribers","subscription_url":"https://api.github.com/repos/kuzzleio/kuzzle/subscription","commits_url":"https://api.github.com/repos/kuzzleio/kuzzle/commits{/sha}","git_commits_url":"https://api.github.com/repos/kuzzleio/kuzzle/git/commits{/sha}","comments_url":"https://api.github.com/repos/kuzzleio/kuzzle/comments{/number}","issue_comment_url":"https://api.github.com/repos/kuzzleio/kuzzle/issues/comments{/number}","contents_url":"https://api.github.com/repos/kuzzleio/kuzzle/contents/{+path}","compare_url":"https://api.github.com/repos/kuzzleio/kuzzle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kuzzleio/kuzzle/merges","archive_url":"https://api.github.com/repos/kuzzleio/kuzzle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kuzzleio/kuzzle/downloads","issues_url":"https://api.github.com/repos/kuzzleio/kuzzle/issues{/number}","pulls_url":"https://api.github.com/repos/kuzzleio/kuzzle/pulls{/number}","milestones_url":"https://api.github.com/repos/kuzzleio/kuzzle/milestones{/number}","notifications_url":"https://api.github.com/repos/kuzzleio/kuzzle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kuzzleio/kuzzle/labels{/name}","releases_url":"https://api.github.com/repos/kuzzleio/kuzzle/releases{/id}","deployments_url":"https://api.github.com/repos/kuzzleio/kuzzle/deployments","created_at":"2015-08-20T08:26:57Z","updated_at":"2016-11-15T07:39:53Z","pushed_at":"2016-11-15T10:06:15Z","git_url":"git://github.com/kuzzleio/kuzzle.git","ssh_url":"git@github.com:kuzzleio/kuzzle.git","clone_url":"https://github.com/kuzzleio/kuzzle.git","svn_url":"https://github.com/kuzzleio/kuzzle","homepage":"http://kuzzle.io","size":9177,"stargazers_count":355,"watchers_count":355,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":57,"forks":21,"open_issues":57,"watchers":355,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kuzzleio/kuzzle/pulls/534"},"html":{"href":"https://github.com/kuzzleio/kuzzle/pull/534"},"issue":{"href":"https://api.github.com/repos/kuzzleio/kuzzle/issues/534"},"comments":{"href":"https://api.github.com/repos/kuzzleio/kuzzle/issues/534/comments"},"review_comments":{"href":"https://api.github.com/repos/kuzzleio/kuzzle/pulls/534/comments"},"review_comment":{"href":"https://api.github.com/repos/kuzzleio/kuzzle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kuzzleio/kuzzle/pulls/534/commits"},"statuses":{"href":"https://api.github.com/repos/kuzzleio/kuzzle/statuses/355b185f954dfab1e60bde9151328d6c16da0298"}}}}
{"actor":{"display_login":"stafyniaksacha"}}