]> git.evergreen-ils.org Git - Evergreen.git/commit
LP#1269911: Teach QueryParser new tricks
authorMike Rylander <mrylander@gmail.com>
Wed, 15 Jan 2014 21:00:52 +0000 (16:00 -0500)
committerDan Wells <dbw2@calvin.edu>
Fri, 21 Feb 2014 20:38:52 +0000 (15:38 -0500)
commitabe6bdf09ea832296baf41daa5dadc378b2fef08
tree956a27f0aea8f498f863dc867c68b6a3d9a5da8e
parentbcc5d4146b49b174be4b8511d791fcfdb6a448b9
LP#1269911: Teach QueryParser new tricks

QP Needs to be made aware of several new structures in the database.

First, we have added a new sort-supporting table called metabib.record_sorter
which holds values extracted by crad.sorter=true attrs.  This is used instead
of the mrd.attrs->"something" hstore composite.

Next, we teach QP how to convert from a list of user-supplied values across
many dynamic filters (based on crad) into an intarray query of ids extracted
from config.coded_value_map (in the case of controlled attributes) or
metabib.uncontrolled_record_attr_value (in the case of, you guessed it,
uncontrolled attributes).  This query is applied against the vlist column
of metabib.record_attr_vector_list, which is GIN indexed for speed.

Finally, metabib.record_attr is now a view over metabib.record_attr_vector_list
and is consequently going to be slow for general use.  We restrict
its inclusion in the core query to only the case of a during() filter
which requires access to the value of a bib's Date2 field.  For the
other common case, requiring access to the Date1 field, we instead
use the pubdate sort value now stored in metabib.record_sorter.  We
might consider making the specific sorter attribute used configurable
so that we can change the definition of pubdate down the road, but it
starts out (and generally stays) defined as equivalent to Date1.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm