LP1901038 Repair Angular catalog journal title search
authorBill Erickson <berickxx@gmail.com>
Thu, 22 Oct 2020 15:10:17 +0000 (11:10 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Fri, 23 Oct 2020 19:25:45 +0000 (15:25 -0400)
Completes the Journal Title search implementation in the Angular staff
catalog.

To test in concerto, search Journal Title => IEEE.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>

Open-ILS/src/eg2/src/app/share/catalog/search-context.ts

index 72683c1..d94e5e2 100644 (file)
@@ -513,12 +513,14 @@ export class CatalogSearchContext {
         let query = ts.query[idx];
         const joinOp = ts.joinOp[idx];
         const matchOp = ts.matchOp[idx];
-        const fieldClass = ts.fieldClass[idx];
+        let fieldClass = ts.fieldClass[idx];
 
         // Bookplates are filters but may be displayed as regular
         // text search indexes.
         if (fieldClass === 'bookplate') { return ''; }
 
+        if (fieldClass === 'jtitle') { fieldClass = 'title'; }
+
         let str = '';
         if (!query) { return str; }
 
@@ -621,6 +623,13 @@ export class CatalogSearchContext {
             }
         });
 
+        // Journal Title queries means performing a title search
+        // with a filter.  Filters are global, so append to the front
+        // of the query.
+        if (ts.fieldClass.filter(fc => fc === 'jtitle').length > 0) {
+            str = 'bib_level(s) ' + str;
+        }
+
         if (ts.hasBrowseEntry) {
             // stored as a comma-separated string of "entryId,fieldId"
             str += ` has_browse_entry(${ts.hasBrowseEntry})`;