mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-15 21:34:46 +00:00

Replaces the old search code with something that's not quite as much spaghetti (e.g. not evolved over too much time), and more stable (actual error handling instead of random crashes) Crawlers are now also multithreaded to deal with higher latency to some sites.
34 lines
816 B
PL/PgSQL
34 lines
816 B
PL/PgSQL
-- Creates configuration 'pg'
|
|
|
|
BEGIN;
|
|
|
|
-- create our configuration to work from
|
|
CREATE TEXT SEARCH CONFIGURATION pg (COPY = pg_catalog.english );
|
|
|
|
-- create english ispell dictionary
|
|
CREATE TEXT SEARCH DICTIONARY english_ispell (
|
|
TEMPLATE = ispell,
|
|
DictFile = en_us,
|
|
AffFile = en_us,
|
|
StopWords = english
|
|
);
|
|
-- create our dictionary
|
|
CREATE TEXT SEARCH DICTIONARY pg_dict (
|
|
TEMPLATE = synonym,
|
|
SYNONYMS = pg_dict
|
|
);
|
|
|
|
-- activate the dictionaries
|
|
ALTER TEXT SEARCH CONFIGURATION pg
|
|
ALTER MAPPING FOR asciiword, asciihword, hword_asciipart,
|
|
word, hword, hword_part
|
|
WITH pg_dict, english_ispell, english_stem;
|
|
|
|
-- parts we don't want to index at all
|
|
ALTER TEXT SEARCH CONFIGURATION pg
|
|
DROP MAPPING FOR email, url, url_path, sfloat, float;
|
|
|
|
-- All done
|
|
|
|
COMMIT;
|