{"action":"created","comment":{"url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/pulls/comments/53311609","id":53311609,"diff_hunk":"@@ -0,0 +1,59 @@\n+'use strict';\n+\n+// Load external modules\n+const Aws = require('aws-sdk');\n+const Twitter = require('twitter-text');\n+\n+class CloudSearchStrategy {\n+  constructor(options) {\n+    this._csd = new Aws.CloudSearchDomain(options);\n+  }\n+\n+  uploadDocuments(params) {\n+    return new Promise((resolve, reject) => {\n+      this._csd.uploadDocuments(params, (err, res) => {\n+        if (err) {\n+          return reject(err);\n+        }\n+        resolve(res);\n+      });\n+    });\n+  }\n+\n+  search(params) {\n+    return new Promise((resolve, reject) => {\n+      this._csd.search(params, (err, res) => {\n+        if (err) {\n+          return reject(err);\n+        }\n+        return resolve(res);\n+      });\n+    });\n+  }\n+\n+  addDocument(idea) {\n+    // Remove certain UTF8 characters from the text\n+    const utf8CharsRegex = /[^\\u0009\\u000a\\u000d\\u0020-\\uD7FF\\uE000-\\uFFFD]/g;\n+    const title = idea.title.replace(utf8CharsRegex, '');\n+    const body = idea.body.replace(utf8CharsRegex, '');\n+\n+    let hashtags = Twitter.extractHashtags(idea.body);","path":"src/strategies/cloudsearch.js","position":40,"original_position":40,"commit_id":"ec8bcab1f00cd22bf4f0bfac813a4fec80668f59","original_commit_id":"ec8bcab1f00cd22bf4f0bfac813a4fec80668f59","user":{"login":"gergoerdosi","id":371149,"avatar_url":"https://avatars.githubusercontent.com/u/371149?v=3","gravatar_id":"","url":"https://api.github.com/users/gergoerdosi","html_url":"https://github.com/gergoerdosi","followers_url":"https://api.github.com/users/gergoerdosi/followers","following_url":"https://api.github.com/users/gergoerdosi/following{/other_user}","gists_url":"https://api.github.com/users/gergoerdosi/gists{/gist_id}","starred_url":"https://api.github.com/users/gergoerdosi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gergoerdosi/subscriptions","organizations_url":"https://api.github.com/users/gergoerdosi/orgs","repos_url":"https://api.github.com/users/gergoerdosi/repos","events_url":"https://api.github.com/users/gergoerdosi/events{/privacy}","received_events_url":"https://api.github.com/users/gergoerdosi/received_events","type":"User","site_admin":false},"body":"Again, hashtags are application specific.","created_at":"2016-02-18T13:16:52Z","updated_at":"2016-02-18T13:16:52Z","html_url":"https://github.com/ideas/hapi-aws-cloudsearch/pull/1#discussion_r53311609","pull_request_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/pulls/comments/53311609"},"html":{"href":"https://github.com/ideas/hapi-aws-cloudsearch/pull/1#discussion_r53311609"},"pull_request":{"href":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/pulls/1","id":59379886,"html_url":"https://github.com/ideas/hapi-aws-cloudsearch/pull/1","diff_url":"https://github.com/ideas/hapi-aws-cloudsearch/pull/1.diff","patch_url":"https://github.com/ideas/hapi-aws-cloudsearch/pull/1.patch","issue_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/issues/1","number":1,"state":"open","locked":false,"title":"Not real AWS mock version","user":{"login":"vblaskovics","id":1146283,"avatar_url":"https://avatars.githubusercontent.com/u/1146283?v=3","gravatar_id":"","url":"https://api.github.com/users/vblaskovics","html_url":"https://github.com/vblaskovics","followers_url":"https://api.github.com/users/vblaskovics/followers","following_url":"https://api.github.com/users/vblaskovics/following{/other_user}","gists_url":"https://api.github.com/users/vblaskovics/gists{/gist_id}","starred_url":"https://api.github.com/users/vblaskovics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vblaskovics/subscriptions","organizations_url":"https://api.github.com/users/vblaskovics/orgs","repos_url":"https://api.github.com/users/vblaskovics/repos","events_url":"https://api.github.com/users/vblaskovics/events{/privacy}","received_events_url":"https://api.github.com/users/vblaskovics/received_events","type":"User","site_admin":false},"body":"In this version I use not the real AWS data in mocks.\r\nAnd i have a question -> you can see it in seach.js file in the TODO comment.","created_at":"2016-02-15T15:43:42Z","updated_at":"2016-02-18T13:16:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"158349b38255f524e574a12ab53b198762dac197","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/pulls/1/commits","review_comments_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/pulls/1/comments","review_comment_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/issues/1/comments","statuses_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/statuses/ec8bcab1f00cd22bf4f0bfac813a4fec80668f59","head":{"label":"vblaskovics:master","ref":"master","sha":"ec8bcab1f00cd22bf4f0bfac813a4fec80668f59","user":{"login":"vblaskovics","id":1146283,"avatar_url":"https://avatars.githubusercontent.com/u/1146283?v=3","gravatar_id":"","url":"https://api.github.com/users/vblaskovics","html_url":"https://github.com/vblaskovics","followers_url":"https://api.github.com/users/vblaskovics/followers","following_url":"https://api.github.com/users/vblaskovics/following{/other_user}","gists_url":"https://api.github.com/users/vblaskovics/gists{/gist_id}","starred_url":"https://api.github.com/users/vblaskovics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vblaskovics/subscriptions","organizations_url":"https://api.github.com/users/vblaskovics/orgs","repos_url":"https://api.github.com/users/vblaskovics/repos","events_url":"https://api.github.com/users/vblaskovics/events{/privacy}","received_events_url":"https://api.github.com/users/vblaskovics/received_events","type":"User","site_admin":false},"repo":{"id":51292338,"name":"hapi-aws-cloudsearch","full_name":"vblaskovics/hapi-aws-cloudsearch","owner":{"login":"vblaskovics","id":1146283,"avatar_url":"https://avatars.githubusercontent.com/u/1146283?v=3","gravatar_id":"","url":"https://api.github.com/users/vblaskovics","html_url":"https://github.com/vblaskovics","followers_url":"https://api.github.com/users/vblaskovics/followers","following_url":"https://api.github.com/users/vblaskovics/following{/other_user}","gists_url":"https://api.github.com/users/vblaskovics/gists{/gist_id}","starred_url":"https://api.github.com/users/vblaskovics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vblaskovics/subscriptions","organizations_url":"https://api.github.com/users/vblaskovics/orgs","repos_url":"https://api.github.com/users/vblaskovics/repos","events_url":"https://api.github.com/users/vblaskovics/events{/privacy}","received_events_url":"https://api.github.com/users/vblaskovics/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vblaskovics/hapi-aws-cloudsearch","description":"","fork":true,"url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch","forks_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/forks","keys_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/teams","hooks_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/hooks","issue_events_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/issues/events{/number}","events_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/events","assignees_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/assignees{/user}","branches_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/branches{/branch}","tags_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/tags","blobs_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/languages","stargazers_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/stargazers","contributors_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/contributors","subscribers_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/subscribers","subscription_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/subscription","commits_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/contents/{+path}","compare_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/merges","archive_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/downloads","issues_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/issues{/number}","pulls_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/labels{/name}","releases_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/releases{/id}","deployments_url":"https://api.github.com/repos/vblaskovics/hapi-aws-cloudsearch/deployments","created_at":"2016-02-08T10:46:36Z","updated_at":"2016-02-08T16:42:12Z","pushed_at":"2016-02-15T15:40:06Z","git_url":"git://github.com/vblaskovics/hapi-aws-cloudsearch.git","ssh_url":"git@github.com:vblaskovics/hapi-aws-cloudsearch.git","clone_url":"https://github.com/vblaskovics/hapi-aws-cloudsearch.git","svn_url":"https://github.com/vblaskovics/hapi-aws-cloudsearch","homepage":null,"size":11,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"ideas:master","ref":"master","sha":"ed53d092065322c585d0b3a4d95b886c283c821d","user":{"login":"ideas","id":3660370,"avatar_url":"https://avatars.githubusercontent.com/u/3660370?v=3","gravatar_id":"","url":"https://api.github.com/users/ideas","html_url":"https://github.com/ideas","followers_url":"https://api.github.com/users/ideas/followers","following_url":"https://api.github.com/users/ideas/following{/other_user}","gists_url":"https://api.github.com/users/ideas/gists{/gist_id}","starred_url":"https://api.github.com/users/ideas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ideas/subscriptions","organizations_url":"https://api.github.com/users/ideas/orgs","repos_url":"https://api.github.com/users/ideas/repos","events_url":"https://api.github.com/users/ideas/events{/privacy}","received_events_url":"https://api.github.com/users/ideas/received_events","type":"Organization","site_admin":false},"repo":{"id":51136692,"name":"hapi-aws-cloudsearch","full_name":"ideas/hapi-aws-cloudsearch","owner":{"login":"ideas","id":3660370,"avatar_url":"https://avatars.githubusercontent.com/u/3660370?v=3","gravatar_id":"","url":"https://api.github.com/users/ideas","html_url":"https://github.com/ideas","followers_url":"https://api.github.com/users/ideas/followers","following_url":"https://api.github.com/users/ideas/following{/other_user}","gists_url":"https://api.github.com/users/ideas/gists{/gist_id}","starred_url":"https://api.github.com/users/ideas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ideas/subscriptions","organizations_url":"https://api.github.com/users/ideas/orgs","repos_url":"https://api.github.com/users/ideas/repos","events_url":"https://api.github.com/users/ideas/events{/privacy}","received_events_url":"https://api.github.com/users/ideas/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ideas/hapi-aws-cloudsearch","description":"AWS CloudSearch integration plugin for hapi.","fork":false,"url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch","forks_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/forks","keys_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/teams","hooks_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/hooks","issue_events_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/issues/events{/number}","events_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/events","assignees_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/assignees{/user}","branches_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/branches{/branch}","tags_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/tags","blobs_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/languages","stargazers_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/stargazers","contributors_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/contributors","subscribers_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/subscribers","subscription_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/subscription","commits_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/contents/{+path}","compare_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/merges","archive_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/downloads","issues_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/issues{/number}","pulls_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/labels{/name}","releases_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/releases{/id}","deployments_url":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/deployments","created_at":"2016-02-05T09:08:50Z","updated_at":"2016-02-11T11:29:43Z","pushed_at":"2016-02-15T15:43:42Z","git_url":"git://github.com/ideas/hapi-aws-cloudsearch.git","ssh_url":"git@github.com:ideas/hapi-aws-cloudsearch.git","clone_url":"https://github.com/ideas/hapi-aws-cloudsearch.git","svn_url":"https://github.com/ideas/hapi-aws-cloudsearch","homepage":"","size":1,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/pulls/1"},"html":{"href":"https://github.com/ideas/hapi-aws-cloudsearch/pull/1"},"issue":{"href":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/issues/1"},"comments":{"href":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/ideas/hapi-aws-cloudsearch/statuses/ec8bcab1f00cd22bf4f0bfac813a4fec80668f59"}}}}