This is a document for PGroonga 2.X. See PGroonga 1.x document when you're using old PGroonga.

pgroonga_normalize function

Since 2.0.3.


pgroonga_normalize function converts a text into a normalized form using Groonga's normalizer modules.


Here is the syntax of this function:

text pgroonga_normalize(target)

target is a text type value to be normalized. By default, it uses the built-in NormalizerAuto normalizer.

Here is another syntax of this function:

text pgroonga_normalize(target, normalizer)

normalizer is a text type value which specifies the normalizer module you want to use.


You can normalize a text type value:

SELECT pgroonga_normalize('aBcDe 123');
--  pgroonga_normalize 
-- --------------------
--  abcde 123
-- (1 row)

You can specify the normalizer:

SELECT pgroonga_command('plugin_register normalizers/mysql');
SELECT pgroonga_normalize('aBcDe 123', 'NormalizerMySQLGeneralCI');
--  pgroonga_normalize 
-- --------------------
--  ABCDE 123
-- (1 row)

plugin_register normalizers/mysql is needed to use groonga-normalizer-mysql. It provides some MySQL compatible normalizers.

You can also specify normalizer options:

SELECT pgroonga_normalize('あア', 'NormalizerNFKC100("unify_kana", true)');
--  pgroonga_normalize 
-- --------------------
--  ああ
-- (1 row)

See also