{"action":"created","comment":{"url":"https://api.github.com/repos/ding2/ding2/pulls/comments/167579167","pull_request_review_id":95816744,"id":167579167,"diff_hunk":"@@ -66,34 +70,44 @@ function ding_serendipity_taxonomy_term_recommended_objects_serendipity_add($con\n  * Fetch recent content from Brønd relating to term in context.\n  */\n function ding_serendipity_taxonomy_term_recent_serendipity_add($context) {\n-  $term_arr = ding_serendipity_taxonomy_get_term($context);\n+  $term_array = ding_serendipity_taxonomy_get_term($context);\n \n   // Validate context.\n-  if ($term_arr === FALSE || !isset($context['recent'])) {\n+  if ($term_array === FALSE || !isset($context['recent'])) {\n     return array();\n   }\n \n-  $facets = array();\n-  $term = $term_arr['term'];\n-\n+  $query = _ding_serendipity_taxonomy_term_query_from_term($term_array);\n   // Select content from this year.\n   $limit = (is_numeric($context['max'])) ? $context['max'] : 16;\n+  $query->setCount($limit);\n \n-  $term_arr['query'] = ding_list_convert_cql($term_arr['query']);\n-\n-  // Apply term query.\n-  $facets[] = $term_arr['query'];\n+  // Order by date.\n+  $query->addSort(TingSearchCommonFields::ACQUISITION_DATE, TingSearchSort::DIRECTION_DESCENDING);","path":"modules/p2/ding_serendipity_taxonomy_term/ding_serendipity_taxonomy_term.module","position":37,"original_position":37,"commit_id":"96d0486caf72fe1f0ed34b0e37940e85cb4c59ed","original_commit_id":"5dbc7bea21f4e6c266526ecd7402d3f3329b9d62","user":{"login":"kasperg","id":73966,"avatar_url":"https://avatars2.githubusercontent.com/u/73966?v=4","gravatar_id":"","url":"https://api.github.com/users/kasperg","html_url":"https://github.com/kasperg","followers_url":"https://api.github.com/users/kasperg/followers","following_url":"https://api.github.com/users/kasperg/following{/other_user}","gists_url":"https://api.github.com/users/kasperg/gists{/gist_id}","starred_url":"https://api.github.com/users/kasperg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasperg/subscriptions","organizations_url":"https://api.github.com/users/kasperg/orgs","repos_url":"https://api.github.com/users/kasperg/repos","events_url":"https://api.github.com/users/kasperg/events{/privacy}","received_events_url":"https://api.github.com/users/kasperg/received_events","type":"User","site_admin":false},"body":"What do you suggest we do here then - remove all references to `TingSearchCommonFields::ACQUISITION_DATE`?","created_at":"2018-02-12T14:57:44Z","updated_at":"2018-02-12T14:57:44Z","html_url":"https://github.com/ding2/ding2/pull/982#discussion_r167579167","pull_request_url":"https://api.github.com/repos/ding2/ding2/pulls/982","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/ding2/ding2/pulls/comments/167579167"},"html":{"href":"https://github.com/ding2/ding2/pull/982#discussion_r167579167"},"pull_request":{"href":"https://api.github.com/repos/ding2/ding2/pulls/982"}},"in_reply_to_id":165032320},"pull_request":{"url":"https://api.github.com/repos/ding2/ding2/pulls/982","id":165671228,"html_url":"https://github.com/ding2/ding2/pull/982","diff_url":"https://github.com/ding2/ding2/pull/982.diff","patch_url":"https://github.com/ding2/ding2/pull/982.patch","issue_url":"https://api.github.com/repos/ding2/ding2/issues/982","number":982,"state":"open","locked":false,"title":"2685: Search abstraction layer","user":{"login":"kasperg","id":73966,"avatar_url":"https://avatars2.githubusercontent.com/u/73966?v=4","gravatar_id":"","url":"https://api.github.com/users/kasperg","html_url":"https://github.com/kasperg","followers_url":"https://api.github.com/users/kasperg/followers","following_url":"https://api.github.com/users/kasperg/following{/other_user}","gists_url":"https://api.github.com/users/kasperg/gists{/gist_id}","starred_url":"https://api.github.com/users/kasperg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasperg/subscriptions","organizations_url":"https://api.github.com/users/kasperg/orgs","repos_url":"https://api.github.com/users/kasperg/repos","events_url":"https://api.github.com/users/kasperg/events{/privacy}","received_events_url":"https://api.github.com/users/kasperg/received_events","type":"User","site_admin":false},"body":"Issue: https://platform.dandigbib.org/issues/2685\r\n\r\nThis pull request implements an abstraction layer between Open Search and other Open* services and the rest of Ding2. The purpose of this is twofold:\r\n\r\n1. The system is no longer intrinsically tied to Open* services and can be used with other search systems such as OpenPlatform and ExLibris Primo\r\n2. Code which accesses data from search services become much cleaner as it does not have to relate to Open Search specific terms and data structures.\r\n\r\nThe changes consists of 3 parts:\r\n\r\n1. Update `ting` modules to use new `search` provider\r\n2. Introduction of a new Open Search `search` provider\r\n3. Update other modules which previously depended on Open* services to use new provider\r\n\r\n### Update ting modules to use new search provider\r\n\r\nThe core of the change is the introduction of a new `search` ding provider type ([see test example](https://github.com/rvk-utd/ding2/blob/bbs-sal/modules/ding_provider/connie_search/includes/connie_search.search.inc)) and [a collection of interfaces which define what data can be returned from such a provider](https://github.com/rvk-utd/ding2/tree/bbs-sal/modules/ting/src).\r\n\r\nThese changes are all located in the `ting` and `ting_search` modules.\r\n\r\n### Introduction of a new Open Search search provider\r\n\r\nThe Open Search module has been created to provide [an implementation of the `search` provider](https://github.com/rvk-utd/ding2/blob/bbs-sal/modules/opensearch/includes/opensearch.search.inc) as well as [implementations of the new interfaces](https://github.com/rvk-utd/ding2/tree/bbs-sal/modules/opensearch/src).\r\n\r\nCode for accessing the Open* services were previously located in the `ting-client`library and in `ting.client.inc`. The library has not been changed in relation to this. The only change in that regard is the fact that it has been moved from the `ting` module to the `opensearch` module. `ting.client.inc` has been moved and renamed to [`opensearch.client.inc`](https://github.com/rvk-utd/ding2/blob/bbs-sal/modules/opensearch/opensearch.client.inc).\r\n\r\nMethods, administration interfaces variables etc. have been updated accordingly. Modules provide install/update hooks to move variables between modules.\r\n\r\n### Update other modules which previously depended on Open* services to use new provider\r\n\r\nModules which should not depend on Open Search have been updated to use new provider hooks and using methods defined by interfaces of the returned objects instead of loading `ting.client.inc` and calling `ting_get_object()`, `ting_do_search()` and accessing the deeply nested `reply` property.\r\n\r\nThe functionality of some modules are directly tied to Open* systems. These have been updated to use `opensearch.client.inc` to signal this dependency instead of calling `ting.client.inc` or the `search` provider. Such modules have also been removed as hard dependencies and are instead enabled on install time.\r\n\r\n### Backwards compatibility \r\n\r\nAs we cannot rely on all third party modules to be updated the PR currently proposes that [the `ting` module still contains a `ting.client.inc` file](https://github.com/rvk-utd/ding2/blob/bbs-sal/modules/ting/ting.client.inc) as that has been a central approach to accessing Open * services. This file contain most of the same methods as the existing file but passes all method invocations to `opensearch.client.inc` and returns the result.\r\n\r\nAll methods here have been marked as `@deprecated` and DocBlocks have been updated with instructions to use the `search` provider or `opensearch` directly.\r\n\r\nNote that commits have not been prefixed with the issue number. This project started before the issue was created.","created_at":"2018-01-29T10:50:37Z","updated_at":"2018-02-12T14:57:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ding2/ding2/pulls/982/commits","review_comments_url":"https://api.github.com/repos/ding2/ding2/pulls/982/comments","review_comment_url":"https://api.github.com/repos/ding2/ding2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ding2/ding2/issues/982/comments","statuses_url":"https://api.github.com/repos/ding2/ding2/statuses/96d0486caf72fe1f0ed34b0e37940e85cb4c59ed","head":{"label":"rvk-utd:bbs-sal","ref":"bbs-sal","sha":"96d0486caf72fe1f0ed34b0e37940e85cb4c59ed","user":{"login":"rvk-utd","id":5630373,"avatar_url":"https://avatars2.githubusercontent.com/u/5630373?v=4","gravatar_id":"","url":"https://api.github.com/users/rvk-utd","html_url":"https://github.com/rvk-utd","followers_url":"https://api.github.com/users/rvk-utd/followers","following_url":"https://api.github.com/users/rvk-utd/following{/other_user}","gists_url":"https://api.github.com/users/rvk-utd/gists{/gist_id}","starred_url":"https://api.github.com/users/rvk-utd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvk-utd/subscriptions","organizations_url":"https://api.github.com/users/rvk-utd/orgs","repos_url":"https://api.github.com/users/rvk-utd/repos","events_url":"https://api.github.com/users/rvk-utd/events{/privacy}","received_events_url":"https://api.github.com/users/rvk-utd/received_events","type":"Organization","site_admin":false},"repo":{"id":92285196,"name":"ding2","full_name":"rvk-utd/ding2","owner":{"login":"rvk-utd","id":5630373,"avatar_url":"https://avatars2.githubusercontent.com/u/5630373?v=4","gravatar_id":"","url":"https://api.github.com/users/rvk-utd","html_url":"https://github.com/rvk-utd","followers_url":"https://api.github.com/users/rvk-utd/followers","following_url":"https://api.github.com/users/rvk-utd/following{/other_user}","gists_url":"https://api.github.com/users/rvk-utd/gists{/gist_id}","starred_url":"https://api.github.com/users/rvk-utd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvk-utd/subscriptions","organizations_url":"https://api.github.com/users/rvk-utd/orgs","repos_url":"https://api.github.com/users/rvk-utd/repos","events_url":"https://api.github.com/users/rvk-utd/events{/privacy}","received_events_url":"https://api.github.com/users/rvk-utd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rvk-utd/ding2","description":"Ding install profile","fork":true,"url":"https://api.github.com/repos/rvk-utd/ding2","forks_url":"https://api.github.com/repos/rvk-utd/ding2/forks","keys_url":"https://api.github.com/repos/rvk-utd/ding2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rvk-utd/ding2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rvk-utd/ding2/teams","hooks_url":"https://api.github.com/repos/rvk-utd/ding2/hooks","issue_events_url":"https://api.github.com/repos/rvk-utd/ding2/issues/events{/number}","events_url":"https://api.github.com/repos/rvk-utd/ding2/events","assignees_url":"https://api.github.com/repos/rvk-utd/ding2/assignees{/user}","branches_url":"https://api.github.com/repos/rvk-utd/ding2/branches{/branch}","tags_url":"https://api.github.com/repos/rvk-utd/ding2/tags","blobs_url":"https://api.github.com/repos/rvk-utd/ding2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rvk-utd/ding2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rvk-utd/ding2/git/refs{/sha}","trees_url":"https://api.github.com/repos/rvk-utd/ding2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rvk-utd/ding2/statuses/{sha}","languages_url":"https://api.github.com/repos/rvk-utd/ding2/languages","stargazers_url":"https://api.github.com/repos/rvk-utd/ding2/stargazers","contributors_url":"https://api.github.com/repos/rvk-utd/ding2/contributors","subscribers_url":"https://api.github.com/repos/rvk-utd/ding2/subscribers","subscription_url":"https://api.github.com/repos/rvk-utd/ding2/subscription","commits_url":"https://api.github.com/repos/rvk-utd/ding2/commits{/sha}","git_commits_url":"https://api.github.com/repos/rvk-utd/ding2/git/commits{/sha}","comments_url":"https://api.github.com/repos/rvk-utd/ding2/comments{/number}","issue_comment_url":"https://api.github.com/repos/rvk-utd/ding2/issues/comments{/number}","contents_url":"https://api.github.com/repos/rvk-utd/ding2/contents/{+path}","compare_url":"https://api.github.com/repos/rvk-utd/ding2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rvk-utd/ding2/merges","archive_url":"https://api.github.com/repos/rvk-utd/ding2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rvk-utd/ding2/downloads","issues_url":"https://api.github.com/repos/rvk-utd/ding2/issues{/number}","pulls_url":"https://api.github.com/repos/rvk-utd/ding2/pulls{/number}","milestones_url":"https://api.github.com/repos/rvk-utd/ding2/milestones{/number}","notifications_url":"https://api.github.com/repos/rvk-utd/ding2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rvk-utd/ding2/labels{/name}","releases_url":"https://api.github.com/repos/rvk-utd/ding2/releases{/id}","deployments_url":"https://api.github.com/repos/rvk-utd/ding2/deployments","created_at":"2017-05-24T11:31:15Z","updated_at":"2017-05-24T11:31:19Z","pushed_at":"2018-02-12T13:11:56Z","git_url":"git://github.com/rvk-utd/ding2.git","ssh_url":"git@github.com:rvk-utd/ding2.git","clone_url":"https://github.com/rvk-utd/ding2.git","svn_url":"https://github.com/rvk-utd/ding2","homepage":"","size":94377,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1,"open_issues":2,"watchers":0,"default_branch":"bbs-master"}},"base":{"label":"ding2:master","ref":"master","sha":"7fae0ce885b9e961eee39023ce981e70b42552ec","user":{"login":"ding2","id":564698,"avatar_url":"https://avatars0.githubusercontent.com/u/564698?v=4","gravatar_id":"","url":"https://api.github.com/users/ding2","html_url":"https://github.com/ding2","followers_url":"https://api.github.com/users/ding2/followers","following_url":"https://api.github.com/users/ding2/following{/other_user}","gists_url":"https://api.github.com/users/ding2/gists{/gist_id}","starred_url":"https://api.github.com/users/ding2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ding2/subscriptions","organizations_url":"https://api.github.com/users/ding2/orgs","repos_url":"https://api.github.com/users/ding2/repos","events_url":"https://api.github.com/users/ding2/events{/privacy}","received_events_url":"https://api.github.com/users/ding2/received_events","type":"Organization","site_admin":false},"repo":{"id":1266749,"name":"ding2","full_name":"ding2/ding2","owner":{"login":"ding2","id":564698,"avatar_url":"https://avatars0.githubusercontent.com/u/564698?v=4","gravatar_id":"","url":"https://api.github.com/users/ding2","html_url":"https://github.com/ding2","followers_url":"https://api.github.com/users/ding2/followers","following_url":"https://api.github.com/users/ding2/following{/other_user}","gists_url":"https://api.github.com/users/ding2/gists{/gist_id}","starred_url":"https://api.github.com/users/ding2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ding2/subscriptions","organizations_url":"https://api.github.com/users/ding2/orgs","repos_url":"https://api.github.com/users/ding2/repos","events_url":"https://api.github.com/users/ding2/events{/privacy}","received_events_url":"https://api.github.com/users/ding2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ding2/ding2","description":"Ding install profile","fork":false,"url":"https://api.github.com/repos/ding2/ding2","forks_url":"https://api.github.com/repos/ding2/ding2/forks","keys_url":"https://api.github.com/repos/ding2/ding2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ding2/ding2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ding2/ding2/teams","hooks_url":"https://api.github.com/repos/ding2/ding2/hooks","issue_events_url":"https://api.github.com/repos/ding2/ding2/issues/events{/number}","events_url":"https://api.github.com/repos/ding2/ding2/events","assignees_url":"https://api.github.com/repos/ding2/ding2/assignees{/user}","branches_url":"https://api.github.com/repos/ding2/ding2/branches{/branch}","tags_url":"https://api.github.com/repos/ding2/ding2/tags","blobs_url":"https://api.github.com/repos/ding2/ding2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ding2/ding2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ding2/ding2/git/refs{/sha}","trees_url":"https://api.github.com/repos/ding2/ding2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ding2/ding2/statuses/{sha}","languages_url":"https://api.github.com/repos/ding2/ding2/languages","stargazers_url":"https://api.github.com/repos/ding2/ding2/stargazers","contributors_url":"https://api.github.com/repos/ding2/ding2/contributors","subscribers_url":"https://api.github.com/repos/ding2/ding2/subscribers","subscription_url":"https://api.github.com/repos/ding2/ding2/subscription","commits_url":"https://api.github.com/repos/ding2/ding2/commits{/sha}","git_commits_url":"https://api.github.com/repos/ding2/ding2/git/commits{/sha}","comments_url":"https://api.github.com/repos/ding2/ding2/comments{/number}","issue_comment_url":"https://api.github.com/repos/ding2/ding2/issues/comments{/number}","contents_url":"https://api.github.com/repos/ding2/ding2/contents/{+path}","compare_url":"https://api.github.com/repos/ding2/ding2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ding2/ding2/merges","archive_url":"https://api.github.com/repos/ding2/ding2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ding2/ding2/downloads","issues_url":"https://api.github.com/repos/ding2/ding2/issues{/number}","pulls_url":"https://api.github.com/repos/ding2/ding2/pulls{/number}","milestones_url":"https://api.github.com/repos/ding2/ding2/milestones{/number}","notifications_url":"https://api.github.com/repos/ding2/ding2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ding2/ding2/labels{/name}","releases_url":"https://api.github.com/repos/ding2/ding2/releases{/id}","deployments_url":"https://api.github.com/repos/ding2/ding2/deployments","created_at":"2011-01-18T10:54:00Z","updated_at":"2016-10-22T05:55:29Z","pushed_at":"2018-02-12T13:11:55Z","git_url":"git://github.com/ding2/ding2.git","ssh_url":"git@github.com:ding2/ding2.git","clone_url":"https://github.com/ding2/ding2.git","svn_url":"https://github.com/ding2/ding2","homepage":"","size":92856,"stargazers_count":12,"watchers_count":12,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":37,"mirror_url":null,"archived":false,"open_issues_count":162,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":37,"open_issues":162,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ding2/ding2/pulls/982"},"html":{"href":"https://github.com/ding2/ding2/pull/982"},"issue":{"href":"https://api.github.com/repos/ding2/ding2/issues/982"},"comments":{"href":"https://api.github.com/repos/ding2/ding2/issues/982/comments"},"review_comments":{"href":"https://api.github.com/repos/ding2/ding2/pulls/982/comments"},"review_comment":{"href":"https://api.github.com/repos/ding2/ding2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ding2/ding2/pulls/982/commits"},"statuses":{"href":"https://api.github.com/repos/ding2/ding2/statuses/96d0486caf72fe1f0ed34b0e37940e85cb4c59ed"}},"author_association":"OWNER"}}
{"actor":{"display_login":"kasperg"}}