From: Galen Charlton Date: Sat, 25 Jan 2020 15:54:26 +0000 (-0500) Subject: add au_by_id option to unified search X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=148a6c8675b6a0295d7123be5f923ef823590e2f;p=working%2FEvergreen.git add au_by_id option to unified search This specifies performing queries on au-linked fields by ID rather than adding joins to query the fields by user barcode or username, etc. Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.service.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.service.ts index 8e9364ef5f..e7d1913f6b 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.service.ts @@ -232,6 +232,7 @@ export class AcqSearchService { const opts = { ...searchOptions[searchType] }; opts['offset'] = pager.offset; opts['limit'] = pager.limit; + opts['au_by_id'] = true; return this.net.request( 'open-ils.acq', 'open-ils.acq.' + searchType + '.unified_search', diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Search.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Search.pm index 14fdced2c2..f6fa48d2b8 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Search.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Search.pm @@ -547,8 +547,10 @@ q/order_by clause must be of the long form, like: $and_terms = prepare_terms($and_terms, 1); $or_terms = prepare_terms($or_terms, 0); - my $offset = add_au_joins($graft_map, $hint, prepare_au_terms($and_terms)); - add_au_joins($graft_map, $hint, prepare_au_terms($or_terms, $offset)); + unless ($options->{au_by_id}) { + my $offset = add_au_joins($graft_map, $hint, prepare_au_terms($and_terms)); + add_au_joins($graft_map, $hint, prepare_au_terms($or_terms, $offset)); + } # The join to acqmapinv needs to be a left join when present. if ($query->{from}{$hint}{acqmapinv}) {