Copy location filter
authorBill Erickson <berickxx@gmail.com>
Tue, 17 Sep 2019 16:20:33 +0000 (12:20 -0400)
committerBill Erickson <berickxx@gmail.com>
Mon, 3 Feb 2020 22:13:59 +0000 (17:13 -0500)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/share/catalog/elastic.service.ts

index 06b55e9..2f18521 100644 (file)
@@ -142,6 +142,13 @@ export class ElasticService {
             }
         });
 
+        if (ts.copyLocations[0] !== '') {
+            const locQuery =
+                new TermsQuery('holdings.location', ts.copyLocations);
+
+            rootNode.filter(new NestedQuery(locQuery, 'holdings'));
+        }
+
         if (ts.date1 && ts.dateOp) {
 
             if (ts.dateOp === 'is') {