{"action":"created","comment":{"url":"https://api.github.com/repos/projectblacklight/blacklight/pulls/comments/198933353","pull_request_review_id":132956281,"id":198933353,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5ODkzMzM1Mw==","diff_hunk":"@@ -137,17 +120,35 @@ def add_blacklight_field config_key, *args, &block\n \n       private\n \n+      ##\n+      # Using the Luke handler see add any fields in the index that match the field_config\n+      def handle_matching_fields(config_key, field_config, &block)\n+        salient_fields = luke_fields.select do |k, _v|\n+          k =~ field_config.match\n+        end\n+\n+        salient_fields.each_key do |field|\n+          config = field_config.dup\n+          config.match = nil\n+          config.field = field\n+          config.key = field\n+          if self[config_key.pluralize][config.key]\n+            self[config_key.pluralize][config.key] = config.merge(self[config_key.pluralize][config.key])\n+          else\n+            add_blacklight_field(config_key, config, &block)\n+          end\n+        end\n+      end\n+\n       def luke_fields\n         if @table[:luke_fields] == false\n           return nil\n         end\n \n         @table[:luke_fields] ||= Rails.cache.fetch(\"blacklight_configuration/admin/luke\", expires_in: 1.hour) do\n           begin\n-            if repository_class <= Blacklight::Solr::Repository\n-              repository = repository_class.new(self)\n-              repository.send_and_receive('admin/luke', params: { fl: '*', 'json.nl' => 'map' })['fields']\n-            end\n+            repository = repository_class.new(self)","path":"lib/blacklight/configuration/fields.rb","position":61,"original_position":61,"commit_id":"79b470c7b1fdd78a896b949114ea422d4ade6ca1","original_commit_id":"79b470c7b1fdd78a896b949114ea422d4ade6ca1","user":{"login":"mjgiarlo","id":131982,"node_id":"MDQ6VXNlcjEzMTk4Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/131982?v=4","gravatar_id":"","url":"https://api.github.com/users/mjgiarlo","html_url":"https://github.com/mjgiarlo","followers_url":"https://api.github.com/users/mjgiarlo/followers","following_url":"https://api.github.com/users/mjgiarlo/following{/other_user}","gists_url":"https://api.github.com/users/mjgiarlo/gists{/gist_id}","starred_url":"https://api.github.com/users/mjgiarlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjgiarlo/subscriptions","organizations_url":"https://api.github.com/users/mjgiarlo/orgs","repos_url":"https://api.github.com/users/mjgiarlo/repos","events_url":"https://api.github.com/users/mjgiarlo/events{/privacy}","received_events_url":"https://api.github.com/users/mjgiarlo/received_events","type":"User","site_admin":false},"body":"Can you safely remove the condition around this?","created_at":"2018-06-28T18:02:27Z","updated_at":"2018-06-28T18:02:28Z","html_url":"https://github.com/projectblacklight/blacklight/pull/1914#discussion_r198933353","pull_request_url":"https://api.github.com/repos/projectblacklight/blacklight/pulls/1914","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/projectblacklight/blacklight/pulls/comments/198933353"},"html":{"href":"https://github.com/projectblacklight/blacklight/pull/1914#discussion_r198933353"},"pull_request":{"href":"https://api.github.com/repos/projectblacklight/blacklight/pulls/1914"}}},"pull_request":{"url":"https://api.github.com/repos/projectblacklight/blacklight/pulls/1914","id":197775334,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3Nzc1MzM0","html_url":"https://github.com/projectblacklight/blacklight/pull/1914","diff_url":"https://github.com/projectblacklight/blacklight/pull/1914.diff","patch_url":"https://github.com/projectblacklight/blacklight/pull/1914.patch","issue_url":"https://api.github.com/repos/projectblacklight/blacklight/issues/1914","number":1914,"state":"open","locked":false,"title":"Extract reflect_fields method to the repository","user":{"login":"jcoyne","id":92044,"node_id":"MDQ6VXNlcjkyMDQ0","avatar_url":"https://avatars2.githubusercontent.com/u/92044?v=4","gravatar_id":"","url":"https://api.github.com/users/jcoyne","html_url":"https://github.com/jcoyne","followers_url":"https://api.github.com/users/jcoyne/followers","following_url":"https://api.github.com/users/jcoyne/following{/other_user}","gists_url":"https://api.github.com/users/jcoyne/gists{/gist_id}","starred_url":"https://api.github.com/users/jcoyne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcoyne/subscriptions","organizations_url":"https://api.github.com/users/jcoyne/orgs","repos_url":"https://api.github.com/users/jcoyne/repos","events_url":"https://api.github.com/users/jcoyne/events{/privacy}","received_events_url":"https://api.github.com/users/jcoyne/received_events","type":"User","site_admin":false},"body":"This allows the repository to implement reflect_fields and allows us to\r\nremove a conditional.","created_at":"2018-06-27T15:42:28Z","updated_at":"2018-06-28T18:02:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"23207df1ea724e93fdf432101af2741425bcc7e7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/projectblacklight/blacklight/pulls/1914/commits","review_comments_url":"https://api.github.com/repos/projectblacklight/blacklight/pulls/1914/comments","review_comment_url":"https://api.github.com/repos/projectblacklight/blacklight/pulls/comments{/number}","comments_url":"https://api.github.com/repos/projectblacklight/blacklight/issues/1914/comments","statuses_url":"https://api.github.com/repos/projectblacklight/blacklight/statuses/79b470c7b1fdd78a896b949114ea422d4ade6ca1","head":{"label":"projectblacklight:reflect_fields","ref":"reflect_fields","sha":"79b470c7b1fdd78a896b949114ea422d4ade6ca1","user":{"login":"projectblacklight","id":120516,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMDUxNg==","avatar_url":"https://avatars1.githubusercontent.com/u/120516?v=4","gravatar_id":"","url":"https://api.github.com/users/projectblacklight","html_url":"https://github.com/projectblacklight","followers_url":"https://api.github.com/users/projectblacklight/followers","following_url":"https://api.github.com/users/projectblacklight/following{/other_user}","gists_url":"https://api.github.com/users/projectblacklight/gists{/gist_id}","starred_url":"https://api.github.com/users/projectblacklight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectblacklight/subscriptions","organizations_url":"https://api.github.com/users/projectblacklight/orgs","repos_url":"https://api.github.com/users/projectblacklight/repos","events_url":"https://api.github.com/users/projectblacklight/events{/privacy}","received_events_url":"https://api.github.com/users/projectblacklight/received_events","type":"Organization","site_admin":false},"repo":{"id":355634,"node_id":"MDEwOlJlcG9zaXRvcnkzNTU2MzQ=","name":"blacklight","full_name":"projectblacklight/blacklight","owner":{"login":"projectblacklight","id":120516,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMDUxNg==","avatar_url":"https://avatars1.githubusercontent.com/u/120516?v=4","gravatar_id":"","url":"https://api.github.com/users/projectblacklight","html_url":"https://github.com/projectblacklight","followers_url":"https://api.github.com/users/projectblacklight/followers","following_url":"https://api.github.com/users/projectblacklight/following{/other_user}","gists_url":"https://api.github.com/users/projectblacklight/gists{/gist_id}","starred_url":"https://api.github.com/users/projectblacklight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectblacklight/subscriptions","organizations_url":"https://api.github.com/users/projectblacklight/orgs","repos_url":"https://api.github.com/users/projectblacklight/repos","events_url":"https://api.github.com/users/projectblacklight/events{/privacy}","received_events_url":"https://api.github.com/users/projectblacklight/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projectblacklight/blacklight","description":"Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr) index.","fork":false,"url":"https://api.github.com/repos/projectblacklight/blacklight","forks_url":"https://api.github.com/repos/projectblacklight/blacklight/forks","keys_url":"https://api.github.com/repos/projectblacklight/blacklight/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projectblacklight/blacklight/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projectblacklight/blacklight/teams","hooks_url":"https://api.github.com/repos/projectblacklight/blacklight/hooks","issue_events_url":"https://api.github.com/repos/projectblacklight/blacklight/issues/events{/number}","events_url":"https://api.github.com/repos/projectblacklight/blacklight/events","assignees_url":"https://api.github.com/repos/projectblacklight/blacklight/assignees{/user}","branches_url":"https://api.github.com/repos/projectblacklight/blacklight/branches{/branch}","tags_url":"https://api.github.com/repos/projectblacklight/blacklight/tags","blobs_url":"https://api.github.com/repos/projectblacklight/blacklight/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projectblacklight/blacklight/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projectblacklight/blacklight/git/refs{/sha}","trees_url":"https://api.github.com/repos/projectblacklight/blacklight/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projectblacklight/blacklight/statuses/{sha}","languages_url":"https://api.github.com/repos/projectblacklight/blacklight/languages","stargazers_url":"https://api.github.com/repos/projectblacklight/blacklight/stargazers","contributors_url":"https://api.github.com/repos/projectblacklight/blacklight/contributors","subscribers_url":"https://api.github.com/repos/projectblacklight/blacklight/subscribers","subscription_url":"https://api.github.com/repos/projectblacklight/blacklight/subscription","commits_url":"https://api.github.com/repos/projectblacklight/blacklight/commits{/sha}","git_commits_url":"https://api.github.com/repos/projectblacklight/blacklight/git/commits{/sha}","comments_url":"https://api.github.com/repos/projectblacklight/blacklight/comments{/number}","issue_comment_url":"https://api.github.com/repos/projectblacklight/blacklight/issues/comments{/number}","contents_url":"https://api.github.com/repos/projectblacklight/blacklight/contents/{+path}","compare_url":"https://api.github.com/repos/projectblacklight/blacklight/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projectblacklight/blacklight/merges","archive_url":"https://api.github.com/repos/projectblacklight/blacklight/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projectblacklight/blacklight/downloads","issues_url":"https://api.github.com/repos/projectblacklight/blacklight/issues{/number}","pulls_url":"https://api.github.com/repos/projectblacklight/blacklight/pulls{/number}","milestones_url":"https://api.github.com/repos/projectblacklight/blacklight/milestones{/number}","notifications_url":"https://api.github.com/repos/projectblacklight/blacklight/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projectblacklight/blacklight/labels{/name}","releases_url":"https://api.github.com/repos/projectblacklight/blacklight/releases{/id}","deployments_url":"https://api.github.com/repos/projectblacklight/blacklight/deployments","created_at":"2009-10-30T20:03:30Z","updated_at":"2018-06-28T11:55:35Z","pushed_at":"2018-06-28T17:55:10Z","git_url":"git://github.com/projectblacklight/blacklight.git","ssh_url":"git@github.com:projectblacklight/blacklight.git","clone_url":"https://github.com/projectblacklight/blacklight.git","svn_url":"https://github.com/projectblacklight/blacklight","homepage":"http://projectblacklight.org/","size":40686,"stargazers_count":552,"watchers_count":552,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":210,"mirror_url":null,"archived":false,"open_issues_count":106,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":210,"open_issues":106,"watchers":552,"default_branch":"master"}},"base":{"label":"projectblacklight:master","ref":"master","sha":"ac2ad4a30c82962524773da427c6b1c6f900357b","user":{"login":"projectblacklight","id":120516,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMDUxNg==","avatar_url":"https://avatars1.githubusercontent.com/u/120516?v=4","gravatar_id":"","url":"https://api.github.com/users/projectblacklight","html_url":"https://github.com/projectblacklight","followers_url":"https://api.github.com/users/projectblacklight/followers","following_url":"https://api.github.com/users/projectblacklight/following{/other_user}","gists_url":"https://api.github.com/users/projectblacklight/gists{/gist_id}","starred_url":"https://api.github.com/users/projectblacklight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectblacklight/subscriptions","organizations_url":"https://api.github.com/users/projectblacklight/orgs","repos_url":"https://api.github.com/users/projectblacklight/repos","events_url":"https://api.github.com/users/projectblacklight/events{/privacy}","received_events_url":"https://api.github.com/users/projectblacklight/received_events","type":"Organization","site_admin":false},"repo":{"id":355634,"node_id":"MDEwOlJlcG9zaXRvcnkzNTU2MzQ=","name":"blacklight","full_name":"projectblacklight/blacklight","owner":{"login":"projectblacklight","id":120516,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMDUxNg==","avatar_url":"https://avatars1.githubusercontent.com/u/120516?v=4","gravatar_id":"","url":"https://api.github.com/users/projectblacklight","html_url":"https://github.com/projectblacklight","followers_url":"https://api.github.com/users/projectblacklight/followers","following_url":"https://api.github.com/users/projectblacklight/following{/other_user}","gists_url":"https://api.github.com/users/projectblacklight/gists{/gist_id}","starred_url":"https://api.github.com/users/projectblacklight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectblacklight/subscriptions","organizations_url":"https://api.github.com/users/projectblacklight/orgs","repos_url":"https://api.github.com/users/projectblacklight/repos","events_url":"https://api.github.com/users/projectblacklight/events{/privacy}","received_events_url":"https://api.github.com/users/projectblacklight/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projectblacklight/blacklight","description":"Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr) index.","fork":false,"url":"https://api.github.com/repos/projectblacklight/blacklight","forks_url":"https://api.github.com/repos/projectblacklight/blacklight/forks","keys_url":"https://api.github.com/repos/projectblacklight/blacklight/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projectblacklight/blacklight/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projectblacklight/blacklight/teams","hooks_url":"https://api.github.com/repos/projectblacklight/blacklight/hooks","issue_events_url":"https://api.github.com/repos/projectblacklight/blacklight/issues/events{/number}","events_url":"https://api.github.com/repos/projectblacklight/blacklight/events","assignees_url":"https://api.github.com/repos/projectblacklight/blacklight/assignees{/user}","branches_url":"https://api.github.com/repos/projectblacklight/blacklight/branches{/branch}","tags_url":"https://api.github.com/repos/projectblacklight/blacklight/tags","blobs_url":"https://api.github.com/repos/projectblacklight/blacklight/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projectblacklight/blacklight/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projectblacklight/blacklight/git/refs{/sha}","trees_url":"https://api.github.com/repos/projectblacklight/blacklight/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projectblacklight/blacklight/statuses/{sha}","languages_url":"https://api.github.com/repos/projectblacklight/blacklight/languages","stargazers_url":"https://api.github.com/repos/projectblacklight/blacklight/stargazers","contributors_url":"https://api.github.com/repos/projectblacklight/blacklight/contributors","subscribers_url":"https://api.github.com/repos/projectblacklight/blacklight/subscribers","subscription_url":"https://api.github.com/repos/projectblacklight/blacklight/subscription","commits_url":"https://api.github.com/repos/projectblacklight/blacklight/commits{/sha}","git_commits_url":"https://api.github.com/repos/projectblacklight/blacklight/git/commits{/sha}","comments_url":"https://api.github.com/repos/projectblacklight/blacklight/comments{/number}","issue_comment_url":"https://api.github.com/repos/projectblacklight/blacklight/issues/comments{/number}","contents_url":"https://api.github.com/repos/projectblacklight/blacklight/contents/{+path}","compare_url":"https://api.github.com/repos/projectblacklight/blacklight/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projectblacklight/blacklight/merges","archive_url":"https://api.github.com/repos/projectblacklight/blacklight/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projectblacklight/blacklight/downloads","issues_url":"https://api.github.com/repos/projectblacklight/blacklight/issues{/number}","pulls_url":"https://api.github.com/repos/projectblacklight/blacklight/pulls{/number}","milestones_url":"https://api.github.com/repos/projectblacklight/blacklight/milestones{/number}","notifications_url":"https://api.github.com/repos/projectblacklight/blacklight/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projectblacklight/blacklight/labels{/name}","releases_url":"https://api.github.com/repos/projectblacklight/blacklight/releases{/id}","deployments_url":"https://api.github.com/repos/projectblacklight/blacklight/deployments","created_at":"2009-10-30T20:03:30Z","updated_at":"2018-06-28T11:55:35Z","pushed_at":"2018-06-28T17:55:10Z","git_url":"git://github.com/projectblacklight/blacklight.git","ssh_url":"git@github.com:projectblacklight/blacklight.git","clone_url":"https://github.com/projectblacklight/blacklight.git","svn_url":"https://github.com/projectblacklight/blacklight","homepage":"http://projectblacklight.org/","size":40686,"stargazers_count":552,"watchers_count":552,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":210,"mirror_url":null,"archived":false,"open_issues_count":106,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":210,"open_issues":106,"watchers":552,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/projectblacklight/blacklight/pulls/1914"},"html":{"href":"https://github.com/projectblacklight/blacklight/pull/1914"},"issue":{"href":"https://api.github.com/repos/projectblacklight/blacklight/issues/1914"},"comments":{"href":"https://api.github.com/repos/projectblacklight/blacklight/issues/1914/comments"},"review_comments":{"href":"https://api.github.com/repos/projectblacklight/blacklight/pulls/1914/comments"},"review_comment":{"href":"https://api.github.com/repos/projectblacklight/blacklight/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/projectblacklight/blacklight/pulls/1914/commits"},"statuses":{"href":"https://api.github.com/repos/projectblacklight/blacklight/statuses/79b470c7b1fdd78a896b949114ea422d4ade6ca1"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"mjgiarlo"}}