Acq: Refactor General Search for more smarts and speed
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fri, 13 Apr 2012 21:18:58 +0000 (17:18 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Tue, 17 Apr 2012 13:20:40 +0000 (09:20 -0400)
commitb36bf07cd6b1f3fb957503ac5699737bf0a49446
tree0a14566ec2cf2e134a0d20a8962a8e4f1dd622ce
parent612ed38c9f0867a4392406bc84bb70abc8172f52
Acq: Refactor General Search for more smarts and speed

This started in response to problems discussed around
https://bugs.launchpad.net/evergreen/+bug/967824 , but it really
addresses a distinct issue from that bug.

Acq General Search relies on lots of joins to make several tables in Acq
searchable by attributes of any of the other tables for rows that happen
to be related.  This is about 1) making better joins and 2) making fewer
joins when you don't need them all for a given search.

Much thanks to Mike Rylander for help figuring out how to efficiently
implement the joins needed for acq.invoice, which is the tricky part.

Less importantly, but still significant for some searches, we also need
case insensitivity for searching on user-linked fields (General Search
always lets you search by any of username/family name/given name/barcode
for these fields) in order to take advantage of some indexes for speed.

This diagram of key Acq relationships is helpful:

https://docs.google.com/drawings/d/15ExkiYvq0skfobbocvPWxwdZkb7aykEZpLGfbP9PL04/view

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Search.pm