Join subqueries as OR'd groups in QueryParser
[working/Evergreen.git] / Open-ILS / src / perlmods / lib / OpenILS / Application / Storage / Driver / Pg / QueryParser.pm
index 669bf20..cbfd99c 100644 (file)
@@ -13,15 +13,17 @@ my ${spc} = ' ' x 2;
 sub subquery_callback {
     my ($invocant, $self, $struct, $filter, $params, $negate) = @_;
 
-    return join(
-        ' ',
-        map {
-            $_->query_text
-        } @{
-            OpenILS::Utils::CStoreEditor
-                ->new
-                ->search_actor_search_query({ id => $params })
-        }
+    return sprintf(' ((%s)) ',
+        join(
+            ') || (',
+            map {
+                $_->query_text
+            } @{
+                OpenILS::Utils::CStoreEditor
+                    ->new
+                    ->search_actor_search_query({ id => $params })
+            }
+        )
     );
 }