Add pref_ou query filter for preferred library searching user/dbs/preferred_lib_located_uris
authorDan Scott <dan@coffeecode.net>
Fri, 6 Apr 2012 18:52:20 +0000 (14:52 -0400)
committerDan Scott <dan@coffeecode.net>
Fri, 6 Apr 2012 18:52:20 +0000 (14:52 -0400)
commitf1e20e8fc6e5ce2f1a1ff84f55c39043fd8c6f80
tree40eb494b7f7e82d7f030120e85b79b830a3ff7e8
parent4643f3613ad57ad4cdcf99a9bf17faf4c63870af
Add pref_ou query filter for preferred library searching

Include the user's "preferred search library" (as set in search
preferences, falling back to home OU) in searches, specifically for the
purposes of ensuring that located URIs at the user's preferred library
would trigger hits where physical copies would be out of scope.

Practical example:

1. User sets preferred search library to BR1.

2. They jump onto the catalogue, log in (which changes their search org
  to their preferred search library of BR1), but then for some reason
  change their search org in the org selector to BR3.

3. They issue a search for "Harry Potter and the Philosopher's Stone".
  BR3 doesn't hold any copies or have any located URIs, but SYS1 (BR1's
  parent) has a PotterMore licence and has added their 856 $9 SYS1 to a
  bib record.

As it currently stands, User is out of luck; they won't see any hits in
search results as there are no copies or located URIs in the BR3 scope.

The proposed enhancement would, however, make the search results contain
a hit for "Harry Potter and the Philosopher's Stone" at the user's
preferred search library.

Sites can trigger the preferred library as part of the query filters
using the "pref_ou(SHORTNAME)" syntax.

Signed-off-by: Dan Scott <dan@coffeecode.net>
Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/metabib.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm
Open-ILS/src/sql/Pg/300.schema.staged_search.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.query_parser_fts.sql [new file with mode: 0644]