Signed-off-by: Mike Rylander <mrylander@gmail.com>
END LOOP;
END IF;
- IF REGEXP_REPLACE(VERSION(),E'^.+?(\\d+\\.\\d+).*?$',E'\\1')::FLOAT > 8.2 THEN
- NEW.index_vector = to_tsvector((TG_ARGV[0])::regconfig, value);
- ELSE
- NEW.index_vector = to_tsvector(TG_ARGV[0], value);
+ IF TG_TABLE_NAME::TEXT ~ 'browse_entry$' THEN
+ value := ARRAY_TO_STRING(regexp_split_to_array(value, E'\\W+'), ' ');
END IF;
+ NEW.index_vector = to_tsvector((TG_ARGV[0])::regconfig, value);
+
RETURN NEW;
END;
$$ LANGUAGE PLPGSQL;