{"action":"created","comment":{"url":"https://api.github.com/repos/NDLANO/article-api/pulls/comments/90824559","pull_request_review_id":11338777,"id":90824559,"diff_hunk":"@@ -21,18 +21,32 @@ import io.searchbox.indices.aliases.{AddAliasMapping, GetAliases, ModifyAliases,\n import io.searchbox.indices.mapping.PutMapping\n import io.searchbox.indices.{CreateIndex, DeleteIndex, IndicesExists}\n import no.ndla.articleapi.ArticleApiProperties\n-import no.ndla.articleapi.integration.ElasticClientComponent\n+import no.ndla.articleapi.integration.ElasticClient\n import no.ndla.articleapi.model.domain.Article\n import no.ndla.articleapi.model.domain.Language.languageAnalyzers\n import no.ndla.articleapi.model.search.SearchableLanguageFormats\n import org.elasticsearch.ElasticsearchException\n import org.json4s.native.Serialization.write\n \n-trait ElasticContentIndexComponent {\n-  this: ElasticClientComponent with SearchConverterService =>\n-  val elasticContentIndex: ElasticContentIndex\n+import scala.util.{Failure, Success, Try}\n \n-  class ElasticContentIndex extends LazyLogging {\n+trait IndexService {\n+  this: ElasticClient with SearchConverterService =>\n+  val indexService: IndexService\n+\n+  class IndexService extends LazyLogging {\n+    implicit val formats = SearchableLanguageFormats.JSonFormats\n+\n+    def indexDocument(article: Article) = {","path":"src/main/scala/no/ndla/articleapi/service/search/IndexService.scala","position":25,"original_position":25,"commit_id":"393fdb2f8588c4120db94891135b5f661c3d34fb","original_commit_id":"393fdb2f8588c4120db94891135b5f661c3d34fb","user":{"login":"runesto","id":24646,"avatar_url":"https://avatars.githubusercontent.com/u/24646?v=3","gravatar_id":"","url":"https://api.github.com/users/runesto","html_url":"https://github.com/runesto","followers_url":"https://api.github.com/users/runesto/followers","following_url":"https://api.github.com/users/runesto/following{/other_user}","gists_url":"https://api.github.com/users/runesto/gists{/gist_id}","starred_url":"https://api.github.com/users/runesto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/runesto/subscriptions","organizations_url":"https://api.github.com/users/runesto/orgs","repos_url":"https://api.github.com/users/runesto/repos","events_url":"https://api.github.com/users/runesto/events{/privacy}","received_events_url":"https://api.github.com/users/runesto/received_events","type":"User","site_admin":false},"body":"Noen ting:\r\n- Synes det ble mye repetisjon mellom denne og den eksisterende som tar en liste av Article. Mulig å samkjøre litt mer?\r\n- Ser heller ingen test på denne nye funksjonen.\r\n- Og mer av nysgjerrighet, hva oppnår du ved å wrappe i en Try, når du ikke håndterer evt. feil før lenger ut?","created_at":"2016-12-05T09:12:57Z","updated_at":"2016-12-05T09:12:57Z","html_url":"https://github.com/NDLANO/article-api/pull/40#discussion_r90824559","pull_request_url":"https://api.github.com/repos/NDLANO/article-api/pulls/40","_links":{"self":{"href":"https://api.github.com/repos/NDLANO/article-api/pulls/comments/90824559"},"html":{"href":"https://github.com/NDLANO/article-api/pull/40#discussion_r90824559"},"pull_request":{"href":"https://api.github.com/repos/NDLANO/article-api/pulls/40"}}},"pull_request":{"url":"https://api.github.com/repos/NDLANO/article-api/pulls/40","id":96489527,"html_url":"https://github.com/NDLANO/article-api/pull/40","diff_url":"https://github.com/NDLANO/article-api/pull/40.diff","patch_url":"https://github.com/NDLANO/article-api/pull/40.patch","issue_url":"https://api.github.com/repos/NDLANO/article-api/issues/40","number":40,"state":"open","locked":false,"title":"Ndlano/issues#124 automatic indexing after article import","user":{"login":"narhen","id":1045380,"avatar_url":"https://avatars.githubusercontent.com/u/1045380?v=3","gravatar_id":"","url":"https://api.github.com/users/narhen","html_url":"https://github.com/narhen","followers_url":"https://api.github.com/users/narhen/followers","following_url":"https://api.github.com/users/narhen/following{/other_user}","gists_url":"https://api.github.com/users/narhen/gists{/gist_id}","starred_url":"https://api.github.com/users/narhen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/narhen/subscriptions","organizations_url":"https://api.github.com/users/narhen/orgs","repos_url":"https://api.github.com/users/narhen/repos","events_url":"https://api.github.com/users/narhen/events{/privacy}","received_events_url":"https://api.github.com/users/narhen/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-05T08:52:58Z","updated_at":"2016-12-05T09:13:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"989120c29fda1719fb10d0124ccc37faaa93722b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/NDLANO/article-api/pulls/40/commits","review_comments_url":"https://api.github.com/repos/NDLANO/article-api/pulls/40/comments","review_comment_url":"https://api.github.com/repos/NDLANO/article-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NDLANO/article-api/issues/40/comments","statuses_url":"https://api.github.com/repos/NDLANO/article-api/statuses/393fdb2f8588c4120db94891135b5f661c3d34fb","head":{"label":"NDLANO:NDLANO/Issues#124-automatic-indexing-after-article-import","ref":"NDLANO/Issues#124-automatic-indexing-after-article-import","sha":"393fdb2f8588c4120db94891135b5f661c3d34fb","user":{"login":"NDLANO","id":20052513,"avatar_url":"https://avatars.githubusercontent.com/u/20052513?v=3","gravatar_id":"","url":"https://api.github.com/users/NDLANO","html_url":"https://github.com/NDLANO","followers_url":"https://api.github.com/users/NDLANO/followers","following_url":"https://api.github.com/users/NDLANO/following{/other_user}","gists_url":"https://api.github.com/users/NDLANO/gists{/gist_id}","starred_url":"https://api.github.com/users/NDLANO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NDLANO/subscriptions","organizations_url":"https://api.github.com/users/NDLANO/orgs","repos_url":"https://api.github.com/users/NDLANO/repos","events_url":"https://api.github.com/users/NDLANO/events{/privacy}","received_events_url":"https://api.github.com/users/NDLANO/received_events","type":"Organization","site_admin":false},"repo":{"id":66824916,"name":"article-api","full_name":"NDLANO/article-api","owner":{"login":"NDLANO","id":20052513,"avatar_url":"https://avatars.githubusercontent.com/u/20052513?v=3","gravatar_id":"","url":"https://api.github.com/users/NDLANO","html_url":"https://github.com/NDLANO","followers_url":"https://api.github.com/users/NDLANO/followers","following_url":"https://api.github.com/users/NDLANO/following{/other_user}","gists_url":"https://api.github.com/users/NDLANO/gists{/gist_id}","starred_url":"https://api.github.com/users/NDLANO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NDLANO/subscriptions","organizations_url":"https://api.github.com/users/NDLANO/orgs","repos_url":"https://api.github.com/users/NDLANO/repos","events_url":"https://api.github.com/users/NDLANO/events{/privacy}","received_events_url":"https://api.github.com/users/NDLANO/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NDLANO/article-api","description":"API for accessing articles from NDLA","fork":false,"url":"https://api.github.com/repos/NDLANO/article-api","forks_url":"https://api.github.com/repos/NDLANO/article-api/forks","keys_url":"https://api.github.com/repos/NDLANO/article-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NDLANO/article-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NDLANO/article-api/teams","hooks_url":"https://api.github.com/repos/NDLANO/article-api/hooks","issue_events_url":"https://api.github.com/repos/NDLANO/article-api/issues/events{/number}","events_url":"https://api.github.com/repos/NDLANO/article-api/events","assignees_url":"https://api.github.com/repos/NDLANO/article-api/assignees{/user}","branches_url":"https://api.github.com/repos/NDLANO/article-api/branches{/branch}","tags_url":"https://api.github.com/repos/NDLANO/article-api/tags","blobs_url":"https://api.github.com/repos/NDLANO/article-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NDLANO/article-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NDLANO/article-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/NDLANO/article-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NDLANO/article-api/statuses/{sha}","languages_url":"https://api.github.com/repos/NDLANO/article-api/languages","stargazers_url":"https://api.github.com/repos/NDLANO/article-api/stargazers","contributors_url":"https://api.github.com/repos/NDLANO/article-api/contributors","subscribers_url":"https://api.github.com/repos/NDLANO/article-api/subscribers","subscription_url":"https://api.github.com/repos/NDLANO/article-api/subscription","commits_url":"https://api.github.com/repos/NDLANO/article-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/NDLANO/article-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/NDLANO/article-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/NDLANO/article-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/NDLANO/article-api/contents/{+path}","compare_url":"https://api.github.com/repos/NDLANO/article-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NDLANO/article-api/merges","archive_url":"https://api.github.com/repos/NDLANO/article-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NDLANO/article-api/downloads","issues_url":"https://api.github.com/repos/NDLANO/article-api/issues{/number}","pulls_url":"https://api.github.com/repos/NDLANO/article-api/pulls{/number}","milestones_url":"https://api.github.com/repos/NDLANO/article-api/milestones{/number}","notifications_url":"https://api.github.com/repos/NDLANO/article-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NDLANO/article-api/labels{/name}","releases_url":"https://api.github.com/repos/NDLANO/article-api/releases{/id}","deployments_url":"https://api.github.com/repos/NDLANO/article-api/deployments","created_at":"2016-08-29T08:17:40Z","updated_at":"2016-11-08T10:50:32Z","pushed_at":"2016-12-05T08:52:58Z","git_url":"git://github.com/NDLANO/article-api.git","ssh_url":"git@github.com:NDLANO/article-api.git","clone_url":"https://github.com/NDLANO/article-api.git","svn_url":"https://github.com/NDLANO/article-api","homepage":null,"size":809,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"NDLANO:master","ref":"master","sha":"3f31ee5f8233c4c8414a1c548d30df20e19ab7c4","user":{"login":"NDLANO","id":20052513,"avatar_url":"https://avatars.githubusercontent.com/u/20052513?v=3","gravatar_id":"","url":"https://api.github.com/users/NDLANO","html_url":"https://github.com/NDLANO","followers_url":"https://api.github.com/users/NDLANO/followers","following_url":"https://api.github.com/users/NDLANO/following{/other_user}","gists_url":"https://api.github.com/users/NDLANO/gists{/gist_id}","starred_url":"https://api.github.com/users/NDLANO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NDLANO/subscriptions","organizations_url":"https://api.github.com/users/NDLANO/orgs","repos_url":"https://api.github.com/users/NDLANO/repos","events_url":"https://api.github.com/users/NDLANO/events{/privacy}","received_events_url":"https://api.github.com/users/NDLANO/received_events","type":"Organization","site_admin":false},"repo":{"id":66824916,"name":"article-api","full_name":"NDLANO/article-api","owner":{"login":"NDLANO","id":20052513,"avatar_url":"https://avatars.githubusercontent.com/u/20052513?v=3","gravatar_id":"","url":"https://api.github.com/users/NDLANO","html_url":"https://github.com/NDLANO","followers_url":"https://api.github.com/users/NDLANO/followers","following_url":"https://api.github.com/users/NDLANO/following{/other_user}","gists_url":"https://api.github.com/users/NDLANO/gists{/gist_id}","starred_url":"https://api.github.com/users/NDLANO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NDLANO/subscriptions","organizations_url":"https://api.github.com/users/NDLANO/orgs","repos_url":"https://api.github.com/users/NDLANO/repos","events_url":"https://api.github.com/users/NDLANO/events{/privacy}","received_events_url":"https://api.github.com/users/NDLANO/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NDLANO/article-api","description":"API for accessing articles from NDLA","fork":false,"url":"https://api.github.com/repos/NDLANO/article-api","forks_url":"https://api.github.com/repos/NDLANO/article-api/forks","keys_url":"https://api.github.com/repos/NDLANO/article-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NDLANO/article-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NDLANO/article-api/teams","hooks_url":"https://api.github.com/repos/NDLANO/article-api/hooks","issue_events_url":"https://api.github.com/repos/NDLANO/article-api/issues/events{/number}","events_url":"https://api.github.com/repos/NDLANO/article-api/events","assignees_url":"https://api.github.com/repos/NDLANO/article-api/assignees{/user}","branches_url":"https://api.github.com/repos/NDLANO/article-api/branches{/branch}","tags_url":"https://api.github.com/repos/NDLANO/article-api/tags","blobs_url":"https://api.github.com/repos/NDLANO/article-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NDLANO/article-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NDLANO/article-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/NDLANO/article-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NDLANO/article-api/statuses/{sha}","languages_url":"https://api.github.com/repos/NDLANO/article-api/languages","stargazers_url":"https://api.github.com/repos/NDLANO/article-api/stargazers","contributors_url":"https://api.github.com/repos/NDLANO/article-api/contributors","subscribers_url":"https://api.github.com/repos/NDLANO/article-api/subscribers","subscription_url":"https://api.github.com/repos/NDLANO/article-api/subscription","commits_url":"https://api.github.com/repos/NDLANO/article-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/NDLANO/article-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/NDLANO/article-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/NDLANO/article-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/NDLANO/article-api/contents/{+path}","compare_url":"https://api.github.com/repos/NDLANO/article-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NDLANO/article-api/merges","archive_url":"https://api.github.com/repos/NDLANO/article-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NDLANO/article-api/downloads","issues_url":"https://api.github.com/repos/NDLANO/article-api/issues{/number}","pulls_url":"https://api.github.com/repos/NDLANO/article-api/pulls{/number}","milestones_url":"https://api.github.com/repos/NDLANO/article-api/milestones{/number}","notifications_url":"https://api.github.com/repos/NDLANO/article-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NDLANO/article-api/labels{/name}","releases_url":"https://api.github.com/repos/NDLANO/article-api/releases{/id}","deployments_url":"https://api.github.com/repos/NDLANO/article-api/deployments","created_at":"2016-08-29T08:17:40Z","updated_at":"2016-11-08T10:50:32Z","pushed_at":"2016-12-05T08:52:58Z","git_url":"git://github.com/NDLANO/article-api.git","ssh_url":"git@github.com:NDLANO/article-api.git","clone_url":"https://github.com/NDLANO/article-api.git","svn_url":"https://github.com/NDLANO/article-api","homepage":null,"size":809,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NDLANO/article-api/pulls/40"},"html":{"href":"https://github.com/NDLANO/article-api/pull/40"},"issue":{"href":"https://api.github.com/repos/NDLANO/article-api/issues/40"},"comments":{"href":"https://api.github.com/repos/NDLANO/article-api/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/NDLANO/article-api/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/NDLANO/article-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NDLANO/article-api/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/NDLANO/article-api/statuses/393fdb2f8588c4120db94891135b5f661c3d34fb"}}}}
{"actor":{"display_login":"runesto"}}