Add pref_ou query filter for preferred library searching collab/dyrcona/preferred_lib_located_uris
authorDan Scott <dan@coffeecode.net>
Fri, 6 Apr 2012 18:52:20 +0000 (14:52 -0400)
committerJason Stephenson <jstephenson@mvlc.org>
Thu, 12 Apr 2012 20:48:04 +0000 (16:48 -0400)
commit0c81adfaaf7449ecf3fecc76c26391f25898ac90
tree7e85f77714277f8ed3e48d7ad6b7c515b8e60557
parent17b8f4abb1d922522ffadc440f4b6e3660718874
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>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
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]