From 33584c43aec4c18b22393d898e065a301b5a2b72 Mon Sep 17 00:00:00 2001
From: Julia Bauder <julia.bauder@gmail.com>
Date: Wed, 11 Nov 2015 08:48:12 -0500
Subject: [PATCH] Support for combined shards

---
 config/vufind/combined.ini                                 | 2 ++
 module/VuFind/src/VuFind/Controller/CombinedController.php | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/config/vufind/combined.ini b/config/vufind/combined.ini
index 48625a997ba..f7eb9458859 100644
--- a/config/vufind/combined.ini
+++ b/config/vufind/combined.ini
@@ -28,6 +28,8 @@
 ;                           will be suppressed (default).
 ; filter = One or more filters to apply to search results displayed in the column.
 ;          Use multiple "filter[] = ..." lines if multiple filters are needed.
+; shard = Limit results to one or more shards (use names from searches.ini, not
+;         URLs). Use multiple "shard[] = ..." lines if multiple shards are needed.
 ;
 ; All display text is subject to translation and may be added to the language
 ; .ini files.
diff --git a/module/VuFind/src/VuFind/Controller/CombinedController.php b/module/VuFind/src/VuFind/Controller/CombinedController.php
index 7ff244878f7..416ac534450 100644
--- a/module/VuFind/src/VuFind/Controller/CombinedController.php
+++ b/module/VuFind/src/VuFind/Controller/CombinedController.php
@@ -265,6 +265,10 @@ class CombinedController extends AbstractSearch
         $query->filter = isset($settings['filter'])
             ? (array)$settings['filter'] : null;
 
+        // Apply shards, if any:
+        $query->shard = isset($settings['shard'])
+            ? (array)$settings['shard'] : null;
+
         // Reset override to avoid bleed-over from one section to the next!
         $query->recommendOverride = false;
 
-- 
GitLab