If a MARC record has effectively empty fields (all space or punctuation)
then it's possible to stumble over a NULL text array when parsing
content for the symspell dictionary. This commit checks for that
condition and returns early to avoid the problem.
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
input := evergreen.lowercase(full_input);
word_list := ARRAY_AGG(x) FROM search.symspell_parse_words_distinct(input) x;
+ IF word_list IS NULL THEN
+ RETURN;
+ END IF;
IF CARDINALITY(word_list) > 1 AND include_phrases THEN
RETURN QUERY SELECT * FROM search.symspell_build_raw_entry(input, source_class, TRUE, prefix_length, maxED);
input := evergreen.lowercase(full_input);
word_list := ARRAY_AGG(x) FROM search.symspell_parse_words_distinct(input) x;
+ IF word_list IS NULL THEN
+ RETURN;
+ END IF;
IF CARDINALITY(word_list) > 1 AND include_phrases THEN
RETURN QUERY SELECT * FROM search.symspell_build_raw_entry(input, source_class, TRUE, prefix_length, maxED);