Created
May 26, 2011 01:31
-
-
Save derencius/992375 to your computer and use it in GitHub Desktop.
Unaccent PostgreSQL 8.4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Adjust this setting to control where the objects get created. | |
SET search_path = public; | |
-- Standalone 'unaccent' function | |
CREATE OR REPLACE FUNCTION unaccent (text) RETURNS text | |
AS '/usr/lib64/pgsql/unaccent' | |
LANGUAGE C IMMUTABLE STRICT; | |
-- New 'unaccentdict' dictionary for text search indexer | |
CREATE OR REPLACE FUNCTION dunaccentdict_init(internal) | |
RETURNS internal | |
AS '/usr/lib64/pgsql/unaccent' | |
LANGUAGE C STRICT; | |
CREATE OR REPLACE FUNCTION dunaccentdict_lexize(internal, internal, internal, internal) | |
RETURNS internal | |
AS '/usr/lib64/pgsql/unaccent' | |
LANGUAGE C STRICT; | |
CREATE TEXT SEARCH TEMPLATE unaccentdict_template ( | |
LEXIZE = dunaccentdict_lexize, | |
INIT = dunaccentdict_init | |
); | |
CREATE TEXT SEARCH DICTIONARY unaccentdict ( | |
TEMPLATE = unaccentdict_template | |
); | |
COMMENT ON TEXT SEARCH DICTIONARY unaccentdict IS 'unaccenting dictionary'; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TEXT SEARCH CONFIGURATION unaccented_portuguese ( COPY = portuguese ); | |
ALTER TEXT SEARCH CONFIGURATION unaccented_portuguese | |
ALTER MAPPING FOR hword, hword_part, word | |
WITH unaccentdict, portuguese_stem; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment