From 57a4cff3579539fc8320e4e2d7b403403e76c2ee Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 23 Jan 2020 10:24:44 -0500 Subject: [PATCH] set default search operator for acqlia fields to "contains" Signed-off-by: Galen Charlton --- .../src/eg2/src/app/staff/acq/search/acq-search-form.component.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.ts index cc7d08ed72..5125c065ad 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.ts @@ -113,6 +113,14 @@ export class AcqSearchFormComponent implements OnInit, AfterViewInit { term.value1 = ''; term.value2 = ''; term.is_date = false; + + if (term.field.startsWith('acqlia:') && term.op === '') { + // default operator for line item attributes should be "contains" + term.op = '__fuzzy'; + } else if (this.searchTermDatatypes[term.field] !== 'text' && term.op.endsWith('__fuzzy')) { + // avoid trying to use the "contains" operator for non-text fields + term.op = ''; + } } // conditionally clear the search term after changing // to selected search operators -- 2.11.0