Maybe speed up search user/miker/reduce-normalization
authorMike Rylander <mrylander@gmail.com>
Thu, 17 May 2012 17:59:04 +0000 (13:59 -0400)
committerMike Rylander <mrylander@gmail.com>
Thu, 17 May 2012 17:59:04 +0000 (13:59 -0400)
commit95cd0f6e9e319f8eb94b941f5df611dd95d4fac9
tree513e952c9a33213b631144e6b5f13b5224ac7ff2
parentf2a11f55a53d3f5a5af1510a4d1016711e0763da
Maybe speed up search

https://bugs.launchpad.net/evergreen/+bug/844374

For investigative purposes, I'm bringing back James' original idea of removing naco_normalize (now spelled search_normalize) from the left side of the comparison.

In order to support this we need to apply all normalizers to the value column in the field entry tables.  That's done in a straight-forward way be just pushing the data into the column at the appropriate time in the appropriate trigger.  There is a small loss of accuracy, because some fields don't get that normalizations when being stored, but the user-supplied value will still be normalized.  But, these are just for relevance adjustment and not matching, so it's not too bad IMO.

Next, we make QueryParser forget about applying search_normalize to the column (but still to the value).

Testing appreciated! (basically untested at this point)

You'll need to rewrite the the field entry tables.  The following should be enough:

UPDATE metabib.author_field_entry SET id = id;
UPDATE metabib.title_field_entry SET id = id;
UPDATE metabib.subject_field_entry SET id = id;
UPDATE metabib.series_field_entry SET id = id;
UPDATE metabib.keyword_field_entry SET id = id;
UPDATE metabib.identifier_field_entry SET id = id;

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
Open-ILS/src/sql/Pg/002.schema.config.sql