{"kind": "fts", "major": "18", "item": {"slug": "configuration-simple", "name": "simple", "name_zh": "", "category": "Configurations", "summary": "Text search configuration simple.", "aliases": [], "content_hash": "56b66a106112c8cdc774ba242af5baaca083560ea72e9aa2d37b4d8e1b714cce", "versions": {"10": {"facts": [{"label": "Configuration", "value": "simple"}, {"label": "Parser", "value": "default"}], "tables": [{"key": "mappings", "rows": [{"token": "asciiword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=10", "text": "simple"}}, {"token": "word", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=10", "text": "simple"}}, {"token": "numword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=10", "text": "simple"}}, {"token": "email", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=10", "text": "simple"}}, {"token": "url", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=10", "text": "simple"}}, {"token": "host", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=10", "text": "simple"}}, {"token": "sfloat", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=10", "text": "simple"}}, {"token": "version", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=10", "text": "simple"}}, {"token": "hword_numpart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=10", "text": "simple"}}, {"token": "hword_part", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=10", "text": "simple"}}, {"token": "hword_asciipart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=10", "text": "simple"}}, {"token": "numhword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=10", "text": "simple"}}, {"token": "asciihword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=10", "text": "simple"}}, {"token": "hword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=10", "text": "simple"}}, {"token": "url_path", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=10", "text": "simple"}}, {"token": "file", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=10", "text": "simple"}}, {"token": "float", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=10", "text": "simple"}}, {"token": "int", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=10", "text": "simple"}}, {"token": "uint", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=10", "text": "simple"}}], "title": "Token-to-dictionary mappings", "columns": [{"key": "token", "label": "Token type"}, {"key": "sequence", "label": "Order"}, {"key": "dictionary", "label": "Dictionary"}]}], "aliases": [], "related": [{"url": "/wiki/fts/parser-default/?v=10", "label": "default parser"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v10.23/postgresql-10.23.tar.bz2", "label": "10.23", "major": "10", "channel": "historical", "revision": "94a4b2528372458e5662c18d406629266667c437198160a18cdfd2c4a4d6eee9", "source_sha256": "94a4b2528372458e5662c18d406629266667c437198160a18cdfd2c4a4d6eee9", "catalog_fingerprint": "691be281b476dde4374d7f805b2bacc2e75bdef40f1e9d3d42e91f97fe95cfd0"}, "sources": [{"url": "https://ftp.postgresql.org/pub/source/v10.23/postgresql-10.23.tar.bz2", "label": "Matching PostgreSQL source archive", "sha256": "94a4b2528372458e5662c18d406629266667c437198160a18cdfd2c4a4d6eee9"}, {"url": "/docs/10/textsearch-configuration.html", "path": "textsearch-configuration.html", "label": "PostgreSQL 10 English manual", "sha256": "fc77a2fba04a408f3a4f11ad06aff02159d190378097384411506059609e6bf7"}], "mappings": [{"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}], "sections": [], "signature": "", "attributes": {"parser": "default", "configuration": "simple"}, "description": ["Text search configuration simple."], "manual_html": "<div class=\"sect1\" id=\"TEXTSEARCH-CONFIGURATION\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\">12.7.\u00a0Configuration Example</h2>\n</div>\n</div>\n</div>\n<p>A text search configuration specifies all options necessary to transform a document into a <code class=\"type\">tsvector</code>: the parser to use to break text into tokens, and the dictionaries to use to transform each token into a lexeme. Every call of <code class=\"function\">to_tsvector</code> or <code class=\"function\">to_tsquery</code> needs a text search configuration to perform its processing. The configuration parameter <a class=\"xref\" href=\"/docs/10/runtime-config-client.html#GUC-DEFAULT-TEXT-SEARCH-CONFIG\">default_text_search_config</a> specifies the name of the default configuration, which is the one used by text search functions if an explicit configuration parameter is omitted. It can be set in <code class=\"filename\">postgresql.conf</code>, or set for an individual session using the <code class=\"command\">SET</code> command.</p>\n<p>Several predefined text search configurations are available, and you can create custom configurations easily. To facilitate management of text search objects, a set of SQL commands is available, and there are several <span class=\"application\">psql</span> commands that display information about text search objects (<a class=\"xref\" href=\"/docs/10/textsearch-psql.html\" title=\"12.10.\u00a0psql Support\">Section\u00a012.10</a>).</p>\n<p>As an example we will create a configuration <code class=\"literal\">pg</code>, starting by duplicating the built-in <code class=\"literal\">english</code> configuration:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH CONFIGURATION public.pg ( COPY = pg_catalog.english );\n</pre>\n<p>We will use a PostgreSQL-specific synonym list and store it in <code class=\"filename\">$SHAREDIR/tsearch_data/pg_dict.syn</code>. The file contents look like:</p>\n<pre class=\"programlisting\">postgres    pg\npgsql       pg\npostgresql  pg\n</pre>\n<p>We define the synonym dictionary like this:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY pg_dict (\n    TEMPLATE = synonym,\n    SYNONYMS = pg_dict\n);\n</pre>\n<p>Next we register the <span class=\"productname\">Ispell</span> dictionary <code class=\"literal\">english_ispell</code>, which has its own configuration files:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY english_ispell (\n    TEMPLATE = ispell,\n    DictFile = english,\n    AffFile = english,\n    StopWords = english\n);\n</pre>\n<p>Now we can set up the mappings for words in configuration <code class=\"literal\">pg</code>:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    ALTER MAPPING FOR asciiword, asciihword, hword_asciipart,\n                      word, hword, hword_part\n    WITH pg_dict, english_ispell, english_stem;\n</pre>\n<p>We choose not to index or search some token types that the built-in configuration does handle:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    DROP MAPPING FOR email, url, url_path, sfloat, float;\n</pre>\n<p>Now we can test our configuration:</p>\n<pre class=\"programlisting\">SELECT * FROM ts_debug('public.pg', '\nPostgreSQL, the highly scalable, SQL compliant, open source object-relational\ndatabase management system, is now undergoing beta testing of the next\nversion of our software.\n');\n</pre>\n<p>The next step is to set the session to use the new configuration, which was created in the <code class=\"literal\">public</code> schema:</p>\n<pre class=\"screen\">=&gt; \\dF\n   List of text search configurations\n Schema  | Name | Description\n---------+------+-------------\n public  | pg   |\n\nSET default_text_search_config = 'public.pg';\nSET\n\nSHOW default_text_search_config;\n default_text_search_config\n----------------------------\n public.pg\n</pre></div>", "manual_path": "/docs/10/textsearch-configuration.html", "comparison_data": {"parser": "default", "mappings": [{"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}]}, "comparison_hash": "840bafee949b0879fa51f540c9c5008d0b8be549c086d4d01dcbffc221deafa1"}, "11": {"facts": [{"label": "Configuration", "value": "simple"}, {"label": "Parser", "value": "default"}], "tables": [{"key": "mappings", "rows": [{"token": "asciiword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=11", "text": "simple"}}, {"token": "word", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=11", "text": "simple"}}, {"token": "numword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=11", "text": "simple"}}, {"token": "email", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=11", "text": "simple"}}, {"token": "url", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=11", "text": "simple"}}, {"token": "host", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=11", "text": "simple"}}, {"token": "sfloat", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=11", "text": "simple"}}, {"token": "version", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=11", "text": "simple"}}, {"token": "hword_numpart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=11", "text": "simple"}}, {"token": "hword_part", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=11", "text": "simple"}}, {"token": "hword_asciipart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=11", "text": "simple"}}, {"token": "numhword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=11", "text": "simple"}}, {"token": "asciihword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=11", "text": "simple"}}, {"token": "hword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=11", "text": "simple"}}, {"token": "url_path", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=11", "text": "simple"}}, {"token": "file", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=11", "text": "simple"}}, {"token": "float", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=11", "text": "simple"}}, {"token": "int", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=11", "text": "simple"}}, {"token": "uint", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=11", "text": "simple"}}], "title": "Token-to-dictionary mappings", "columns": [{"key": "token", "label": "Token type"}, {"key": "sequence", "label": "Order"}, {"key": "dictionary", "label": "Dictionary"}]}], "aliases": [], "related": [{"url": "/wiki/fts/parser-default/?v=11", "label": "default parser"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v11.22/postgresql-11.22.tar.bz2", "label": "11.22", "major": "11", "channel": "historical", "revision": "2cb7c97d7a0d7278851bbc9c61f467b69c094c72b81740b751108e7892ebe1f0", "source_sha256": "2cb7c97d7a0d7278851bbc9c61f467b69c094c72b81740b751108e7892ebe1f0", "catalog_fingerprint": "8f21f4444b7f68923f4762af0eb7937fa2907026e91249483e79050de012c901"}, "sources": [{"url": "https://ftp.postgresql.org/pub/source/v11.22/postgresql-11.22.tar.bz2", "label": "Matching PostgreSQL source archive", "sha256": "2cb7c97d7a0d7278851bbc9c61f467b69c094c72b81740b751108e7892ebe1f0"}, {"url": "/docs/11/textsearch-configuration.html", "path": "textsearch-configuration.html", "label": "PostgreSQL 11 English manual", "sha256": "bf93b35a8c82ba8d611561d5d3bdc8b4ee42b41e54c672111c89cb5a155232a2"}], "mappings": [{"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}], "sections": [], "signature": "", "attributes": {"parser": "default", "configuration": "simple"}, "description": ["Text search configuration simple."], "manual_html": "<div class=\"sect1\" id=\"TEXTSEARCH-CONFIGURATION\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\">12.7.\u00a0Configuration Example</h2>\n</div>\n</div>\n</div>\n<p>A text search configuration specifies all options necessary to transform a document into a <code class=\"type\">tsvector</code>: the parser to use to break text into tokens, and the dictionaries to use to transform each token into a lexeme. Every call of <code class=\"function\">to_tsvector</code> or <code class=\"function\">to_tsquery</code> needs a text search configuration to perform its processing. The configuration parameter <a class=\"xref\" href=\"/docs/11/runtime-config-client.html#GUC-DEFAULT-TEXT-SEARCH-CONFIG\">default_text_search_config</a> specifies the name of the default configuration, which is the one used by text search functions if an explicit configuration parameter is omitted. It can be set in <code class=\"filename\">postgresql.conf</code>, or set for an individual session using the <code class=\"command\">SET</code> command.</p>\n<p>Several predefined text search configurations are available, and you can create custom configurations easily. To facilitate management of text search objects, a set of SQL commands is available, and there are several <span class=\"application\">psql</span> commands that display information about text search objects (<a class=\"xref\" href=\"/docs/11/textsearch-psql.html\" title=\"12.10.\u00a0psql Support\">Section\u00a012.10</a>).</p>\n<p>As an example we will create a configuration <code class=\"literal\">pg</code>, starting by duplicating the built-in <code class=\"literal\">english</code> configuration:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH CONFIGURATION public.pg ( COPY = pg_catalog.english );\n</pre>\n<p>We will use a PostgreSQL-specific synonym list and store it in <code class=\"filename\">$SHAREDIR/tsearch_data/pg_dict.syn</code>. The file contents look like:</p>\n<pre class=\"programlisting\">postgres    pg\npgsql       pg\npostgresql  pg\n</pre>\n<p>We define the synonym dictionary like this:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY pg_dict (\n    TEMPLATE = synonym,\n    SYNONYMS = pg_dict\n);\n</pre>\n<p>Next we register the <span class=\"productname\">Ispell</span> dictionary <code class=\"literal\">english_ispell</code>, which has its own configuration files:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY english_ispell (\n    TEMPLATE = ispell,\n    DictFile = english,\n    AffFile = english,\n    StopWords = english\n);\n</pre>\n<p>Now we can set up the mappings for words in configuration <code class=\"literal\">pg</code>:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    ALTER MAPPING FOR asciiword, asciihword, hword_asciipart,\n                      word, hword, hword_part\n    WITH pg_dict, english_ispell, english_stem;\n</pre>\n<p>We choose not to index or search some token types that the built-in configuration does handle:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    DROP MAPPING FOR email, url, url_path, sfloat, float;\n</pre>\n<p>Now we can test our configuration:</p>\n<pre class=\"programlisting\">SELECT * FROM ts_debug('public.pg', '\nPostgreSQL, the highly scalable, SQL compliant, open source object-relational\ndatabase management system, is now undergoing beta testing of the next\nversion of our software.\n');\n</pre>\n<p>The next step is to set the session to use the new configuration, which was created in the <code class=\"literal\">public</code> schema:</p>\n<pre class=\"screen\">=&gt; \\dF\n   List of text search configurations\n Schema  | Name | Description\n---------+------+-------------\n public  | pg   |\n\nSET default_text_search_config = 'public.pg';\nSET\n\nSHOW default_text_search_config;\n default_text_search_config\n----------------------------\n public.pg\n</pre>\n</div>", "manual_path": "/docs/11/textsearch-configuration.html", "comparison_data": {"parser": "default", "mappings": [{"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}]}, "comparison_hash": "840bafee949b0879fa51f540c9c5008d0b8be549c086d4d01dcbffc221deafa1"}, "12": {"facts": [{"label": "Configuration", "value": "simple"}, {"label": "Parser", "value": "default"}], "tables": [{"key": "mappings", "rows": [{"token": "asciiword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=12", "text": "simple"}}, {"token": "word", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=12", "text": "simple"}}, {"token": "numword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=12", "text": "simple"}}, {"token": "email", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=12", "text": "simple"}}, {"token": "url", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=12", "text": "simple"}}, {"token": "host", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=12", "text": "simple"}}, {"token": "sfloat", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=12", "text": "simple"}}, {"token": "version", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=12", "text": "simple"}}, {"token": "hword_numpart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=12", "text": "simple"}}, {"token": "hword_part", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=12", "text": "simple"}}, {"token": "hword_asciipart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=12", "text": "simple"}}, {"token": "numhword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=12", "text": "simple"}}, {"token": "asciihword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=12", "text": "simple"}}, {"token": "hword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=12", "text": "simple"}}, {"token": "url_path", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=12", "text": "simple"}}, {"token": "file", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=12", "text": "simple"}}, {"token": "float", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=12", "text": "simple"}}, {"token": "int", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=12", "text": "simple"}}, {"token": "uint", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=12", "text": "simple"}}], "title": "Token-to-dictionary mappings", "columns": [{"key": "token", "label": "Token type"}, {"key": "sequence", "label": "Order"}, {"key": "dictionary", "label": "Dictionary"}]}], "aliases": [], "related": [{"url": "/wiki/fts/parser-default/?v=12", "label": "default parser"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v12.22/postgresql-12.22.tar.bz2", "label": "12.22", "major": "12", "channel": "historical", "revision": "8df3c0474782589d3c6f374b5133b1bd14d168086edbc13c6e72e67dd4527a3b", "source_sha256": "8df3c0474782589d3c6f374b5133b1bd14d168086edbc13c6e72e67dd4527a3b", "catalog_fingerprint": "9f857f4ee4875f9c7de6bfc9df4b757dec8b3a0bb88eadb519c7bd267bd56149"}, "sources": [{"url": "https://ftp.postgresql.org/pub/source/v12.22/postgresql-12.22.tar.bz2", "label": "Matching PostgreSQL source archive", "sha256": "8df3c0474782589d3c6f374b5133b1bd14d168086edbc13c6e72e67dd4527a3b"}, {"url": "/docs/12/textsearch-configuration.html", "path": "textsearch-configuration.html", "label": "PostgreSQL 12 English manual", "sha256": "94f68950017a5a2943715e16826e1b0d1c9d766744e57328087731598fa234b2"}], "mappings": [{"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}], "sections": [], "signature": "", "attributes": {"parser": "default", "configuration": "simple"}, "description": ["Text search configuration simple."], "manual_html": "<div class=\"sect1\" id=\"TEXTSEARCH-CONFIGURATION\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\">12.7.\u00a0Configuration Example</h2>\n</div>\n</div>\n</div>\n<p>A text search configuration specifies all options necessary to transform a document into a <code class=\"type\">tsvector</code>: the parser to use to break text into tokens, and the dictionaries to use to transform each token into a lexeme. Every call of <code class=\"function\">to_tsvector</code> or <code class=\"function\">to_tsquery</code> needs a text search configuration to perform its processing. The configuration parameter <a class=\"xref\" href=\"/docs/12/runtime-config-client.html#GUC-DEFAULT-TEXT-SEARCH-CONFIG\">default_text_search_config</a> specifies the name of the default configuration, which is the one used by text search functions if an explicit configuration parameter is omitted. It can be set in <code class=\"filename\">postgresql.conf</code>, or set for an individual session using the <code class=\"command\">SET</code> command.</p>\n<p>Several predefined text search configurations are available, and you can create custom configurations easily. To facilitate management of text search objects, a set of SQL commands is available, and there are several <span class=\"application\">psql</span> commands that display information about text search objects (<a class=\"xref\" href=\"/docs/12/textsearch-psql.html\" title=\"12.10.\u00a0psql Support\">Section\u00a012.10</a>).</p>\n<p>As an example we will create a configuration <code class=\"literal\">pg</code>, starting by duplicating the built-in <code class=\"literal\">english</code> configuration:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH CONFIGURATION public.pg ( COPY = pg_catalog.english );\n</pre>\n<p>We will use a PostgreSQL-specific synonym list and store it in <code class=\"filename\">$SHAREDIR/tsearch_data/pg_dict.syn</code>. The file contents look like:</p>\n<pre class=\"programlisting\">postgres    pg\npgsql       pg\npostgresql  pg\n</pre>\n<p>We define the synonym dictionary like this:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY pg_dict (\n    TEMPLATE = synonym,\n    SYNONYMS = pg_dict\n);\n</pre>\n<p>Next we register the <span class=\"productname\">Ispell</span> dictionary <code class=\"literal\">english_ispell</code>, which has its own configuration files:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY english_ispell (\n    TEMPLATE = ispell,\n    DictFile = english,\n    AffFile = english,\n    StopWords = english\n);\n</pre>\n<p>Now we can set up the mappings for words in configuration <code class=\"literal\">pg</code>:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    ALTER MAPPING FOR asciiword, asciihword, hword_asciipart,\n                      word, hword, hword_part\n    WITH pg_dict, english_ispell, english_stem;\n</pre>\n<p>We choose not to index or search some token types that the built-in configuration does handle:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    DROP MAPPING FOR email, url, url_path, sfloat, float;\n</pre>\n<p>Now we can test our configuration:</p>\n<pre class=\"programlisting\">SELECT * FROM ts_debug('public.pg', '\nPostgreSQL, the highly scalable, SQL compliant, open source object-relational\ndatabase management system, is now undergoing beta testing of the next\nversion of our software.\n');\n</pre>\n<p>The next step is to set the session to use the new configuration, which was created in the <code class=\"literal\">public</code> schema:</p>\n<pre class=\"screen\">=&gt; \\dF\n   List of text search configurations\n Schema  | Name | Description\n---------+------+-------------\n public  | pg   |\n\nSET default_text_search_config = 'public.pg';\nSET\n\nSHOW default_text_search_config;\n default_text_search_config\n----------------------------\n public.pg\n</pre>\n</div>", "manual_path": "/docs/12/textsearch-configuration.html", "comparison_data": {"parser": "default", "mappings": [{"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}]}, "comparison_hash": "840bafee949b0879fa51f540c9c5008d0b8be549c086d4d01dcbffc221deafa1"}, "13": {"facts": [{"label": "Configuration", "value": "simple"}, {"label": "Parser", "value": "default"}], "tables": [{"key": "mappings", "rows": [{"token": "asciiword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=13", "text": "simple"}}, {"token": "word", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=13", "text": "simple"}}, {"token": "numword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=13", "text": "simple"}}, {"token": "email", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=13", "text": "simple"}}, {"token": "url", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=13", "text": "simple"}}, {"token": "host", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=13", "text": "simple"}}, {"token": "sfloat", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=13", "text": "simple"}}, {"token": "version", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=13", "text": "simple"}}, {"token": "hword_numpart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=13", "text": "simple"}}, {"token": "hword_part", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=13", "text": "simple"}}, {"token": "hword_asciipart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=13", "text": "simple"}}, {"token": "numhword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=13", "text": "simple"}}, {"token": "asciihword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=13", "text": "simple"}}, {"token": "hword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=13", "text": "simple"}}, {"token": "url_path", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=13", "text": "simple"}}, {"token": "file", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=13", "text": "simple"}}, {"token": "float", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=13", "text": "simple"}}, {"token": "int", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=13", "text": "simple"}}, {"token": "uint", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=13", "text": "simple"}}], "title": "Token-to-dictionary mappings", "columns": [{"key": "token", "label": "Token type"}, {"key": "sequence", "label": "Order"}, {"key": "dictionary", "label": "Dictionary"}]}], "aliases": [], "related": [{"url": "/wiki/fts/parser-default/?v=13", "label": "default parser"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v13.23/postgresql-13.23.tar.bz2", "label": "13.23", "major": "13", "channel": "historical", "revision": "6ec3c82726af92b7dec873fa1cdf881eca92a4219787dfad05acb6b10e041fd6", "source_sha256": "6ec3c82726af92b7dec873fa1cdf881eca92a4219787dfad05acb6b10e041fd6", "catalog_fingerprint": "c7015c845255c9d721c547c8ab9ef37825d332588c9691d982e6906b7d571002"}, "sources": [{"url": "https://ftp.postgresql.org/pub/source/v13.23/postgresql-13.23.tar.bz2", "label": "Matching PostgreSQL source archive", "sha256": "6ec3c82726af92b7dec873fa1cdf881eca92a4219787dfad05acb6b10e041fd6"}, {"url": "/docs/13/textsearch-configuration.html", "path": "textsearch-configuration.html", "label": "PostgreSQL 13 English manual", "sha256": "6dce07f2bdf0a61fbc512906c346a890d4ec6841c2792cda28aed00018306c33"}], "mappings": [{"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}], "sections": [], "signature": "", "attributes": {"parser": "default", "configuration": "simple"}, "description": ["Text search configuration simple."], "manual_html": "<div class=\"sect1\" id=\"TEXTSEARCH-CONFIGURATION\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\">12.7.\u00a0Configuration Example</h2>\n</div>\n</div>\n</div>\n<p>A text search configuration specifies all options necessary to transform a document into a <code class=\"type\">tsvector</code>: the parser to use to break text into tokens, and the dictionaries to use to transform each token into a lexeme. Every call of <code class=\"function\">to_tsvector</code> or <code class=\"function\">to_tsquery</code> needs a text search configuration to perform its processing. The configuration parameter <a class=\"xref\" href=\"/docs/13/runtime-config-client.html#GUC-DEFAULT-TEXT-SEARCH-CONFIG\">default_text_search_config</a> specifies the name of the default configuration, which is the one used by text search functions if an explicit configuration parameter is omitted. It can be set in <code class=\"filename\">postgresql.conf</code>, or set for an individual session using the <code class=\"command\">SET</code> command.</p>\n<p>Several predefined text search configurations are available, and you can create custom configurations easily. To facilitate management of text search objects, a set of SQL commands is available, and there are several <span class=\"application\">psql</span> commands that display information about text search objects (<a class=\"xref\" href=\"/docs/13/textsearch-psql.html\" title=\"12.10.\u00a0psql Support\">Section\u00a012.10</a>).</p>\n<p>As an example we will create a configuration <code class=\"literal\">pg</code>, starting by duplicating the built-in <code class=\"literal\">english</code> configuration:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH CONFIGURATION public.pg ( COPY = pg_catalog.english );\n</pre>\n<p>We will use a PostgreSQL-specific synonym list and store it in <code class=\"filename\">$SHAREDIR/tsearch_data/pg_dict.syn</code>. The file contents look like:</p>\n<pre class=\"programlisting\">postgres    pg\npgsql       pg\npostgresql  pg\n</pre>\n<p>We define the synonym dictionary like this:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY pg_dict (\n    TEMPLATE = synonym,\n    SYNONYMS = pg_dict\n);\n</pre>\n<p>Next we register the <span class=\"productname\">Ispell</span> dictionary <code class=\"literal\">english_ispell</code>, which has its own configuration files:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY english_ispell (\n    TEMPLATE = ispell,\n    DictFile = english,\n    AffFile = english,\n    StopWords = english\n);\n</pre>\n<p>Now we can set up the mappings for words in configuration <code class=\"literal\">pg</code>:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    ALTER MAPPING FOR asciiword, asciihword, hword_asciipart,\n                      word, hword, hword_part\n    WITH pg_dict, english_ispell, english_stem;\n</pre>\n<p>We choose not to index or search some token types that the built-in configuration does handle:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    DROP MAPPING FOR email, url, url_path, sfloat, float;\n</pre>\n<p>Now we can test our configuration:</p>\n<pre class=\"programlisting\">SELECT * FROM ts_debug('public.pg', '\nPostgreSQL, the highly scalable, SQL compliant, open source object-relational\ndatabase management system, is now undergoing beta testing of the next\nversion of our software.\n');\n</pre>\n<p>The next step is to set the session to use the new configuration, which was created in the <code class=\"literal\">public</code> schema:</p>\n<pre class=\"screen\">=&gt; \\dF\n   List of text search configurations\n Schema  | Name | Description\n---------+------+-------------\n public  | pg   |\n\nSET default_text_search_config = 'public.pg';\nSET\n\nSHOW default_text_search_config;\n default_text_search_config\n----------------------------\n public.pg\n</pre>\n</div>", "manual_path": "/docs/13/textsearch-configuration.html", "comparison_data": {"parser": "default", "mappings": [{"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}]}, "comparison_hash": "840bafee949b0879fa51f540c9c5008d0b8be549c086d4d01dcbffc221deafa1"}, "14": {"facts": [{"label": "Configuration", "value": "simple"}, {"label": "Parser", "value": "default"}], "tables": [{"key": "mappings", "rows": [{"token": "asciiword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=14", "text": "simple"}}, {"token": "word", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=14", "text": "simple"}}, {"token": "numword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=14", "text": "simple"}}, {"token": "email", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=14", "text": "simple"}}, {"token": "url", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=14", "text": "simple"}}, {"token": "host", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=14", "text": "simple"}}, {"token": "sfloat", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=14", "text": "simple"}}, {"token": "version", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=14", "text": "simple"}}, {"token": "hword_numpart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=14", "text": "simple"}}, {"token": "hword_part", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=14", "text": "simple"}}, {"token": "hword_asciipart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=14", "text": "simple"}}, {"token": "numhword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=14", "text": "simple"}}, {"token": "asciihword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=14", "text": "simple"}}, {"token": "hword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=14", "text": "simple"}}, {"token": "url_path", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=14", "text": "simple"}}, {"token": "file", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=14", "text": "simple"}}, {"token": "float", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=14", "text": "simple"}}, {"token": "int", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=14", "text": "simple"}}, {"token": "uint", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=14", "text": "simple"}}], "title": "Token-to-dictionary mappings", "columns": [{"key": "token", "label": "Token type"}, {"key": "sequence", "label": "Order"}, {"key": "dictionary", "label": "Dictionary"}]}], "aliases": [], "related": [{"url": "/wiki/fts/parser-default/?v=14", "label": "default parser"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v14.24/postgresql-14.24.tar.bz2", "label": "14.24", "major": "14", "channel": "stable", "revision": "a7fa7ed3d558172355f51406097a7bd4f6b473be80f311ef7cda96bf383d8897", "source_sha256": "a7fa7ed3d558172355f51406097a7bd4f6b473be80f311ef7cda96bf383d8897", "catalog_fingerprint": "b272e6a82e4c46efda81c3a6a4cdf7de6a83dfff7f02f226a392fbe9acdd3adb"}, "sources": [{"url": "https://ftp.postgresql.org/pub/source/v14.24/postgresql-14.24.tar.bz2", "label": "Matching PostgreSQL source archive", "sha256": "a7fa7ed3d558172355f51406097a7bd4f6b473be80f311ef7cda96bf383d8897"}, {"url": "/docs/14/textsearch-configuration.html", "path": "textsearch-configuration.html", "label": "PostgreSQL 14 English manual", "sha256": "ddf909a1152235b56c4f2788b34e591e215c1da46d3a759c30b7cd2b9b60c70a"}], "mappings": [{"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}], "sections": [], "signature": "", "attributes": {"parser": "default", "configuration": "simple"}, "description": ["Text search configuration simple."], "manual_html": "<div class=\"sect1\" id=\"TEXTSEARCH-CONFIGURATION\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\">12.7.\u00a0Configuration Example</h2>\n</div>\n</div>\n</div>\n<p>A text search configuration specifies all options necessary to transform a document into a <code class=\"type\">tsvector</code>: the parser to use to break text into tokens, and the dictionaries to use to transform each token into a lexeme. Every call of <code class=\"function\">to_tsvector</code> or <code class=\"function\">to_tsquery</code> needs a text search configuration to perform its processing. The configuration parameter <a class=\"xref\" href=\"/docs/14/runtime-config-client.html#GUC-DEFAULT-TEXT-SEARCH-CONFIG\">default_text_search_config</a> specifies the name of the default configuration, which is the one used by text search functions if an explicit configuration parameter is omitted. It can be set in <code class=\"filename\">postgresql.conf</code>, or set for an individual session using the <code class=\"command\">SET</code> command.</p>\n<p>Several predefined text search configurations are available, and you can create custom configurations easily. To facilitate management of text search objects, a set of SQL commands is available, and there are several <span class=\"application\">psql</span> commands that display information about text search objects (<a class=\"xref\" href=\"/docs/14/textsearch-psql.html\" title=\"12.10.\u00a0psql Support\">Section\u00a012.10</a>).</p>\n<p>As an example we will create a configuration <code class=\"literal\">pg</code>, starting by duplicating the built-in <code class=\"literal\">english</code> configuration:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH CONFIGURATION public.pg ( COPY = pg_catalog.english );\n</pre>\n<p>We will use a PostgreSQL-specific synonym list and store it in <code class=\"filename\">$SHAREDIR/tsearch_data/pg_dict.syn</code>. The file contents look like:</p>\n<pre class=\"programlisting\">postgres    pg\npgsql       pg\npostgresql  pg\n</pre>\n<p>We define the synonym dictionary like this:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY pg_dict (\n    TEMPLATE = synonym,\n    SYNONYMS = pg_dict\n);\n</pre>\n<p>Next we register the <span class=\"productname\">Ispell</span> dictionary <code class=\"literal\">english_ispell</code>, which has its own configuration files:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY english_ispell (\n    TEMPLATE = ispell,\n    DictFile = english,\n    AffFile = english,\n    StopWords = english\n);\n</pre>\n<p>Now we can set up the mappings for words in configuration <code class=\"literal\">pg</code>:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    ALTER MAPPING FOR asciiword, asciihword, hword_asciipart,\n                      word, hword, hword_part\n    WITH pg_dict, english_ispell, english_stem;\n</pre>\n<p>We choose not to index or search some token types that the built-in configuration does handle:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    DROP MAPPING FOR email, url, url_path, sfloat, float;\n</pre>\n<p>Now we can test our configuration:</p>\n<pre class=\"programlisting\">SELECT * FROM ts_debug('public.pg', '\nPostgreSQL, the highly scalable, SQL compliant, open source object-relational\ndatabase management system, is now undergoing beta testing of the next\nversion of our software.\n');\n</pre>\n<p>The next step is to set the session to use the new configuration, which was created in the <code class=\"literal\">public</code> schema:</p>\n<pre class=\"screen\">=&gt; \\dF\n   List of text search configurations\n Schema  | Name | Description\n---------+------+-------------\n public  | pg   |\n\nSET default_text_search_config = 'public.pg';\nSET\n\nSHOW default_text_search_config;\n default_text_search_config\n----------------------------\n public.pg\n</pre>\n</div>", "manual_path": "/docs/14/textsearch-configuration.html", "comparison_data": {"parser": "default", "mappings": [{"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}]}, "comparison_hash": "840bafee949b0879fa51f540c9c5008d0b8be549c086d4d01dcbffc221deafa1"}, "15": {"facts": [{"label": "Configuration", "value": "simple"}, {"label": "Parser", "value": "default"}], "tables": [{"key": "mappings", "rows": [{"token": "asciiword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=15", "text": "simple"}}, {"token": "word", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=15", "text": "simple"}}, {"token": "numword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=15", "text": "simple"}}, {"token": "email", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=15", "text": "simple"}}, {"token": "url", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=15", "text": "simple"}}, {"token": "host", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=15", "text": "simple"}}, {"token": "sfloat", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=15", "text": "simple"}}, {"token": "version", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=15", "text": "simple"}}, {"token": "hword_numpart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=15", "text": "simple"}}, {"token": "hword_part", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=15", "text": "simple"}}, {"token": "hword_asciipart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=15", "text": "simple"}}, {"token": "numhword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=15", "text": "simple"}}, {"token": "asciihword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=15", "text": "simple"}}, {"token": "hword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=15", "text": "simple"}}, {"token": "url_path", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=15", "text": "simple"}}, {"token": "file", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=15", "text": "simple"}}, {"token": "float", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=15", "text": "simple"}}, {"token": "int", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=15", "text": "simple"}}, {"token": "uint", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=15", "text": "simple"}}], "title": "Token-to-dictionary mappings", "columns": [{"key": "token", "label": "Token type"}, {"key": "sequence", "label": "Order"}, {"key": "dictionary", "label": "Dictionary"}]}], "aliases": [], "related": [{"url": "/wiki/fts/parser-default/?v=15", "label": "default parser"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v15.19/postgresql-15.19.tar.bz2", "label": "15.19", "major": "15", "channel": "stable", "revision": "e1a64a87a46b825b88c082e4518161a47aab53c45694964f8ba1df28f7859f89", "source_sha256": "e1a64a87a46b825b88c082e4518161a47aab53c45694964f8ba1df28f7859f89", "catalog_fingerprint": "fefe3c425147a86defada190c9b0663cfe02caa1724f5dede93e46457572252d"}, "sources": [{"url": "https://ftp.postgresql.org/pub/source/v15.19/postgresql-15.19.tar.bz2", "label": "Matching PostgreSQL source archive", "sha256": "e1a64a87a46b825b88c082e4518161a47aab53c45694964f8ba1df28f7859f89"}, {"url": "/docs/15/textsearch-configuration.html", "path": "textsearch-configuration.html", "label": "PostgreSQL 15 English manual", "sha256": "1a2f4d4b9c2e47e293d13b928b8420747c30283265e51c822308ace5735a043d"}], "mappings": [{"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}], "sections": [], "signature": "", "attributes": {"parser": "default", "configuration": "simple"}, "description": ["Text search configuration simple."], "manual_html": "<div class=\"sect1\" id=\"TEXTSEARCH-CONFIGURATION\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\">12.7.\u00a0Configuration Example</h2>\n</div>\n</div>\n</div>\n<p>A text search configuration specifies all options necessary to transform a document into a <code class=\"type\">tsvector</code>: the parser to use to break text into tokens, and the dictionaries to use to transform each token into a lexeme. Every call of <code class=\"function\">to_tsvector</code> or <code class=\"function\">to_tsquery</code> needs a text search configuration to perform its processing. The configuration parameter <a class=\"xref\" href=\"/docs/15/runtime-config-client.html#GUC-DEFAULT-TEXT-SEARCH-CONFIG\">default_text_search_config</a> specifies the name of the default configuration, which is the one used by text search functions if an explicit configuration parameter is omitted. It can be set in <code class=\"filename\">postgresql.conf</code>, or set for an individual session using the <code class=\"command\">SET</code> command.</p>\n<p>Several predefined text search configurations are available, and you can create custom configurations easily. To facilitate management of text search objects, a set of SQL commands is available, and there are several <span class=\"application\">psql</span> commands that display information about text search objects (<a class=\"xref\" href=\"/docs/15/textsearch-psql.html\" title=\"12.10.\u00a0psql Support\">Section\u00a012.10</a>).</p>\n<p>As an example we will create a configuration <code class=\"literal\">pg</code>, starting by duplicating the built-in <code class=\"literal\">english</code> configuration:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH CONFIGURATION public.pg ( COPY = pg_catalog.english );\n</pre>\n<p>We will use a PostgreSQL-specific synonym list and store it in <code class=\"filename\">$SHAREDIR/tsearch_data/pg_dict.syn</code>. The file contents look like:</p>\n<pre class=\"programlisting\">postgres    pg\npgsql       pg\npostgresql  pg\n</pre>\n<p>We define the synonym dictionary like this:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY pg_dict (\n    TEMPLATE = synonym,\n    SYNONYMS = pg_dict\n);\n</pre>\n<p>Next we register the <span class=\"productname\">Ispell</span> dictionary <code class=\"literal\">english_ispell</code>, which has its own configuration files:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY english_ispell (\n    TEMPLATE = ispell,\n    DictFile = english,\n    AffFile = english,\n    StopWords = english\n);\n</pre>\n<p>Now we can set up the mappings for words in configuration <code class=\"literal\">pg</code>:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    ALTER MAPPING FOR asciiword, asciihword, hword_asciipart,\n                      word, hword, hword_part\n    WITH pg_dict, english_ispell, english_stem;\n</pre>\n<p>We choose not to index or search some token types that the built-in configuration does handle:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    DROP MAPPING FOR email, url, url_path, sfloat, float;\n</pre>\n<p>Now we can test our configuration:</p>\n<pre class=\"programlisting\">SELECT * FROM ts_debug('public.pg', '\nPostgreSQL, the highly scalable, SQL compliant, open source object-relational\ndatabase management system, is now undergoing beta testing of the next\nversion of our software.\n');\n</pre>\n<p>The next step is to set the session to use the new configuration, which was created in the <code class=\"literal\">public</code> schema:</p>\n<pre class=\"screen\">=&gt; \\dF\n   List of text search configurations\n Schema  | Name | Description\n---------+------+-------------\n public  | pg   |\n\nSET default_text_search_config = 'public.pg';\nSET\n\nSHOW default_text_search_config;\n default_text_search_config\n----------------------------\n public.pg\n</pre>\n</div>", "manual_path": "/docs/15/textsearch-configuration.html", "comparison_data": {"parser": "default", "mappings": [{"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}]}, "comparison_hash": "840bafee949b0879fa51f540c9c5008d0b8be549c086d4d01dcbffc221deafa1"}, "16": {"facts": [{"label": "Configuration", "value": "simple"}, {"label": "Parser", "value": "default"}], "tables": [{"key": "mappings", "rows": [{"token": "asciiword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=16", "text": "simple"}}, {"token": "word", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=16", "text": "simple"}}, {"token": "numword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=16", "text": "simple"}}, {"token": "email", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=16", "text": "simple"}}, {"token": "url", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=16", "text": "simple"}}, {"token": "host", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=16", "text": "simple"}}, {"token": "sfloat", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=16", "text": "simple"}}, {"token": "version", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=16", "text": "simple"}}, {"token": "hword_numpart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=16", "text": "simple"}}, {"token": "hword_part", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=16", "text": "simple"}}, {"token": "hword_asciipart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=16", "text": "simple"}}, {"token": "numhword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=16", "text": "simple"}}, {"token": "asciihword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=16", "text": "simple"}}, {"token": "hword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=16", "text": "simple"}}, {"token": "url_path", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=16", "text": "simple"}}, {"token": "file", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=16", "text": "simple"}}, {"token": "float", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=16", "text": "simple"}}, {"token": "int", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=16", "text": "simple"}}, {"token": "uint", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=16", "text": "simple"}}], "title": "Token-to-dictionary mappings", "columns": [{"key": "token", "label": "Token type"}, {"key": "sequence", "label": "Order"}, {"key": "dictionary", "label": "Dictionary"}]}], "aliases": [], "related": [{"url": "/wiki/fts/parser-default/?v=16", "label": "default parser"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v16.15/postgresql-16.15.tar.bz2", "label": "16.15", "major": "16", "channel": "stable", "revision": "c1575341fa7bd40f5274ea465b34390f4dc64cdd0770af327005caaeb9f6b7ed", "source_sha256": "c1575341fa7bd40f5274ea465b34390f4dc64cdd0770af327005caaeb9f6b7ed", "catalog_fingerprint": "fa133458dc8f52e15083b4f59b7a582e2e378b608d3ac5c53054df458a374e23"}, "sources": [{"url": "https://ftp.postgresql.org/pub/source/v16.15/postgresql-16.15.tar.bz2", "label": "Matching PostgreSQL source archive", "sha256": "c1575341fa7bd40f5274ea465b34390f4dc64cdd0770af327005caaeb9f6b7ed"}, {"url": "/docs/16/textsearch-configuration.html", "path": "textsearch-configuration.html", "label": "PostgreSQL 16 English manual", "sha256": "4a26236464c858040fa8e59710468e61d130391d40ef3c3c54f3257a2992f5b5"}], "mappings": [{"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}], "sections": [], "signature": "", "attributes": {"parser": "default", "configuration": "simple"}, "description": ["Text search configuration simple."], "manual_html": "<div class=\"sect1\" id=\"TEXTSEARCH-CONFIGURATION\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\">12.7.\u00a0Configuration Example </h2>\n</div>\n</div>\n</div>\n<p>A text search configuration specifies all options necessary to transform a document into a <code class=\"type\">tsvector</code>: the parser to use to break text into tokens, and the dictionaries to use to transform each token into a lexeme. Every call of <code class=\"function\">to_tsvector</code> or <code class=\"function\">to_tsquery</code> needs a text search configuration to perform its processing. The configuration parameter <a class=\"xref\" href=\"/docs/16/runtime-config-client.html#GUC-DEFAULT-TEXT-SEARCH-CONFIG\">default_text_search_config</a> specifies the name of the default configuration, which is the one used by text search functions if an explicit configuration parameter is omitted. It can be set in <code class=\"filename\">postgresql.conf</code>, or set for an individual session using the <code class=\"command\">SET</code> command.</p>\n<p>Several predefined text search configurations are available, and you can create custom configurations easily. To facilitate management of text search objects, a set of SQL commands is available, and there are several <span class=\"application\">psql</span> commands that display information about text search objects (<a class=\"xref\" href=\"/docs/16/textsearch-psql.html\" title=\"12.10.\u00a0psql Support\">Section\u00a012.10</a>).</p>\n<p>As an example we will create a configuration <code class=\"literal\">pg</code>, starting by duplicating the built-in <code class=\"literal\">english</code> configuration:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH CONFIGURATION public.pg ( COPY = pg_catalog.english );\n</pre>\n<p>We will use a PostgreSQL-specific synonym list and store it in <code class=\"filename\">$SHAREDIR/tsearch_data/pg_dict.syn</code>. The file contents look like:</p>\n<pre class=\"programlisting\">postgres    pg\npgsql       pg\npostgresql  pg\n</pre>\n<p>We define the synonym dictionary like this:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY pg_dict (\n    TEMPLATE = synonym,\n    SYNONYMS = pg_dict\n);\n</pre>\n<p>Next we register the <span class=\"productname\">Ispell</span> dictionary <code class=\"literal\">english_ispell</code>, which has its own configuration files:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY english_ispell (\n    TEMPLATE = ispell,\n    DictFile = english,\n    AffFile = english,\n    StopWords = english\n);\n</pre>\n<p>Now we can set up the mappings for words in configuration <code class=\"literal\">pg</code>:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    ALTER MAPPING FOR asciiword, asciihword, hword_asciipart,\n                      word, hword, hword_part\n    WITH pg_dict, english_ispell, english_stem;\n</pre>\n<p>We choose not to index or search some token types that the built-in configuration does handle:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    DROP MAPPING FOR email, url, url_path, sfloat, float;\n</pre>\n<p>Now we can test our configuration:</p>\n<pre class=\"programlisting\">SELECT * FROM ts_debug('public.pg', '\nPostgreSQL, the highly scalable, SQL compliant, open source object-relational\ndatabase management system, is now undergoing beta testing of the next\nversion of our software.\n');\n</pre>\n<p>The next step is to set the session to use the new configuration, which was created in the <code class=\"literal\">public</code> schema:</p>\n<pre class=\"screen\">=&gt; \\dF\n   List of text search configurations\n Schema  | Name | Description\n---------+------+-------------\n public  | pg   |\n\nSET default_text_search_config = 'public.pg';\nSET\n\nSHOW default_text_search_config;\n default_text_search_config\n----------------------------\n public.pg\n</pre>\n</div>", "manual_path": "/docs/16/textsearch-configuration.html", "comparison_data": {"parser": "default", "mappings": [{"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}]}, "comparison_hash": "840bafee949b0879fa51f540c9c5008d0b8be549c086d4d01dcbffc221deafa1"}, "17": {"facts": [{"label": "Configuration", "value": "simple"}, {"label": "Parser", "value": "default"}], "tables": [{"key": "mappings", "rows": [{"token": "asciiword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=17", "text": "simple"}}, {"token": "word", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=17", "text": "simple"}}, {"token": "numword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=17", "text": "simple"}}, {"token": "email", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=17", "text": "simple"}}, {"token": "url", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=17", "text": "simple"}}, {"token": "host", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=17", "text": "simple"}}, {"token": "sfloat", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=17", "text": "simple"}}, {"token": "version", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=17", "text": "simple"}}, {"token": "hword_numpart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=17", "text": "simple"}}, {"token": "hword_part", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=17", "text": "simple"}}, {"token": "hword_asciipart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=17", "text": "simple"}}, {"token": "numhword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=17", "text": "simple"}}, {"token": "asciihword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=17", "text": "simple"}}, {"token": "hword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=17", "text": "simple"}}, {"token": "url_path", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=17", "text": "simple"}}, {"token": "file", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=17", "text": "simple"}}, {"token": "float", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=17", "text": "simple"}}, {"token": "int", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=17", "text": "simple"}}, {"token": "uint", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=17", "text": "simple"}}], "title": "Token-to-dictionary mappings", "columns": [{"key": "token", "label": "Token type"}, {"key": "sequence", "label": "Order"}, {"key": "dictionary", "label": "Dictionary"}]}], "aliases": [], "related": [{"url": "/wiki/fts/parser-default/?v=17", "label": "default parser"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v17.11/postgresql-17.11.tar.bz2", "label": "17.11", "major": "17", "channel": "stable", "revision": "dd27f2b3c59e73ed14aa3324901242bf69a032a6347805f274e6260322d42979", "source_sha256": "dd27f2b3c59e73ed14aa3324901242bf69a032a6347805f274e6260322d42979", "catalog_fingerprint": "4bbe3ac77becd618478f66aec420a533e9017be356c5c1d51a4b17f0fd497c07"}, "sources": [{"url": "https://ftp.postgresql.org/pub/source/v17.11/postgresql-17.11.tar.bz2", "label": "Matching PostgreSQL source archive", "sha256": "dd27f2b3c59e73ed14aa3324901242bf69a032a6347805f274e6260322d42979"}, {"url": "/docs/17/textsearch-configuration.html", "path": "textsearch-configuration.html", "label": "PostgreSQL 17 English manual", "sha256": "0dabf4ac25ebd86f33d1422a40d9c69fd4d1dd9d38e8a960aa2ad22ffce551ff"}], "mappings": [{"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}], "sections": [], "signature": "", "attributes": {"parser": "default", "configuration": "simple"}, "description": ["Text search configuration simple."], "manual_html": "<div class=\"sect1\" id=\"TEXTSEARCH-CONFIGURATION\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\">12.7.\u00a0Configuration Example </h2>\n</div>\n</div>\n</div>\n<p>A text search configuration specifies all options necessary to transform a document into a <code class=\"type\">tsvector</code>: the parser to use to break text into tokens, and the dictionaries to use to transform each token into a lexeme. Every call of <code class=\"function\">to_tsvector</code> or <code class=\"function\">to_tsquery</code> needs a text search configuration to perform its processing. The configuration parameter <a class=\"xref\" href=\"/docs/17/runtime-config-client.html#GUC-DEFAULT-TEXT-SEARCH-CONFIG\">default_text_search_config</a> specifies the name of the default configuration, which is the one used by text search functions if an explicit configuration parameter is omitted. It can be set in <code class=\"filename\">postgresql.conf</code>, or set for an individual session using the <code class=\"command\">SET</code> command.</p>\n<p>Several predefined text search configurations are available, and you can create custom configurations easily. To facilitate management of text search objects, a set of SQL commands is available, and there are several <span class=\"application\">psql</span> commands that display information about text search objects (<a class=\"xref\" href=\"/docs/17/textsearch-psql.html\" title=\"12.10.\u00a0psql Support\">Section\u00a012.10</a>).</p>\n<p>As an example we will create a configuration <code class=\"literal\">pg</code>, starting by duplicating the built-in <code class=\"literal\">english</code> configuration:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH CONFIGURATION public.pg ( COPY = pg_catalog.english );\n</pre>\n<p>We will use a PostgreSQL-specific synonym list and store it in <code class=\"filename\">$SHAREDIR/tsearch_data/pg_dict.syn</code>. The file contents look like:</p>\n<pre class=\"programlisting\">postgres    pg\npgsql       pg\npostgresql  pg\n</pre>\n<p>We define the synonym dictionary like this:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY pg_dict (\n    TEMPLATE = synonym,\n    SYNONYMS = pg_dict\n);\n</pre>\n<p>Next we register the <span class=\"productname\">Ispell</span> dictionary <code class=\"literal\">english_ispell</code>, which has its own configuration files:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY english_ispell (\n    TEMPLATE = ispell,\n    DictFile = english,\n    AffFile = english,\n    StopWords = english\n);\n</pre>\n<p>Now we can set up the mappings for words in configuration <code class=\"literal\">pg</code>:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    ALTER MAPPING FOR asciiword, asciihword, hword_asciipart,\n                      word, hword, hword_part\n    WITH pg_dict, english_ispell, english_stem;\n</pre>\n<p>We choose not to index or search some token types that the built-in configuration does handle:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    DROP MAPPING FOR email, url, url_path, sfloat, float;\n</pre>\n<p>Now we can test our configuration:</p>\n<pre class=\"programlisting\">SELECT * FROM ts_debug('public.pg', '\nPostgreSQL, the highly scalable, SQL compliant, open source object-relational\ndatabase management system, is now undergoing beta testing of the next\nversion of our software.\n');\n</pre>\n<p>The next step is to set the session to use the new configuration, which was created in the <code class=\"literal\">public</code> schema:</p>\n<pre class=\"screen\">=&gt; \\dF\n   List of text search configurations\n Schema  | Name | Description\n---------+------+-------------\n public  | pg   |\n\nSET default_text_search_config = 'public.pg';\nSET\n\nSHOW default_text_search_config;\n default_text_search_config\n----------------------------\n public.pg\n</pre>\n</div>", "manual_path": "/docs/17/textsearch-configuration.html", "comparison_data": {"parser": "default", "mappings": [{"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}]}, "comparison_hash": "840bafee949b0879fa51f540c9c5008d0b8be549c086d4d01dcbffc221deafa1"}, "18": {"facts": [{"label": "Configuration", "value": "simple"}, {"label": "Parser", "value": "default"}], "tables": [{"key": "mappings", "rows": [{"token": "asciiword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "word", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "numword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "email", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "url", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "host", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "sfloat", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "version", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "hword_numpart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "hword_part", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "hword_asciipart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "numhword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "asciihword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "hword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "url_path", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "file", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "float", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "int", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "uint", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}], "title": "Token-to-dictionary mappings", "columns": [{"key": "token", "label": "Token type"}, {"key": "sequence", "label": "Order"}, {"key": "dictionary", "label": "Dictionary"}]}], "aliases": [], "related": [{"url": "/wiki/fts/parser-default/?v=18", "label": "default parser"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "label": "18.6", "major": "18", "channel": "stable", "revision": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f", "source_sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f", "catalog_fingerprint": "65c93d6048ef30e61023a84f9680fa6a92b1c383b7eb226741170077eb078502"}, "sources": [{"url": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "label": "Matching PostgreSQL source archive", "sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}, {"url": "/docs/18/textsearch-configuration.html", "path": "textsearch-configuration.html", "label": "PostgreSQL 18 English manual", "sha256": "7957c03871a5f267f642ec609b2e3d1404eb000ccdef21ca0d1d8a8616110dc9"}], "mappings": [{"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}], "sections": [], "signature": "", "attributes": {"parser": "default", "configuration": "simple"}, "description": ["Text search configuration simple."], "manual_html": "<div class=\"sect1\" id=\"TEXTSEARCH-CONFIGURATION\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\">12.7.\u00a0Configuration Example </h2>\n</div>\n</div>\n</div>\n<p>A text search configuration specifies all options necessary to transform a document into a <code class=\"type\">tsvector</code>: the parser to use to break text into tokens, and the dictionaries to use to transform each token into a lexeme. Every call of <code class=\"function\">to_tsvector</code> or <code class=\"function\">to_tsquery</code> needs a text search configuration to perform its processing. The configuration parameter <a class=\"xref\" href=\"/docs/18/runtime-config-client.html#GUC-DEFAULT-TEXT-SEARCH-CONFIG\">default_text_search_config</a> specifies the name of the default configuration, which is the one used by text search functions if an explicit configuration parameter is omitted. It can be set in <code class=\"filename\">postgresql.conf</code>, or set for an individual session using the <code class=\"command\">SET</code> command.</p>\n<p>Several predefined text search configurations are available, and you can create custom configurations easily. To facilitate management of text search objects, a set of SQL commands is available, and there are several <span class=\"application\">psql</span> commands that display information about text search objects (<a class=\"xref\" href=\"/docs/18/textsearch-psql.html\" title=\"12.10.\u00a0psql Support\">Section\u00a012.10</a>).</p>\n<p>As an example we will create a configuration <code class=\"literal\">pg</code>, starting by duplicating the built-in <code class=\"literal\">english</code> configuration:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH CONFIGURATION public.pg ( COPY = pg_catalog.english );\n</pre>\n<p>We will use a PostgreSQL-specific synonym list and store it in <code class=\"filename\">$SHAREDIR/tsearch_data/pg_dict.syn</code>. The file contents look like:</p>\n<pre class=\"programlisting\">postgres    pg\npgsql       pg\npostgresql  pg\n</pre>\n<p>We define the synonym dictionary like this:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY pg_dict (\n    TEMPLATE = synonym,\n    SYNONYMS = pg_dict\n);\n</pre>\n<p>Next we register the <span class=\"productname\">Ispell</span> dictionary <code class=\"literal\">english_ispell</code>, which has its own configuration files:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY english_ispell (\n    TEMPLATE = ispell,\n    DictFile = english,\n    AffFile = english,\n    StopWords = english\n);\n</pre>\n<p>Now we can set up the mappings for words in configuration <code class=\"literal\">pg</code>:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    ALTER MAPPING FOR asciiword, asciihword, hword_asciipart,\n                      word, hword, hword_part\n    WITH pg_dict, english_ispell, english_stem;\n</pre>\n<p>We choose not to index or search some token types that the built-in configuration does handle:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    DROP MAPPING FOR email, url, url_path, sfloat, float;\n</pre>\n<p>Now we can test our configuration:</p>\n<pre class=\"programlisting\">SELECT * FROM ts_debug('public.pg', '\nPostgreSQL, the highly scalable, SQL compliant, open source object-relational\ndatabase management system, is now undergoing beta testing of the next\nversion of our software.\n');\n</pre>\n<p>The next step is to set the session to use the new configuration, which was created in the <code class=\"literal\">public</code> schema:</p>\n<pre class=\"screen\">=&gt; \\dF\n   List of text search configurations\n Schema  | Name | Description\n---------+------+-------------\n public  | pg   |\n\nSET default_text_search_config = 'public.pg';\nSET\n\nSHOW default_text_search_config;\n default_text_search_config\n----------------------------\n public.pg\n</pre>\n</div>", "manual_path": "/docs/18/textsearch-configuration.html", "comparison_data": {"parser": "default", "mappings": [{"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}]}, "comparison_hash": "840bafee949b0879fa51f540c9c5008d0b8be549c086d4d01dcbffc221deafa1"}, "19": {"facts": [{"label": "Configuration", "value": "simple"}, {"label": "Parser", "value": "default"}], "tables": [{"key": "mappings", "rows": [{"token": "asciiword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=19", "text": "simple"}}, {"token": "word", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=19", "text": "simple"}}, {"token": "numword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=19", "text": "simple"}}, {"token": "email", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=19", "text": "simple"}}, {"token": "url", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=19", "text": "simple"}}, {"token": "host", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=19", "text": "simple"}}, {"token": "sfloat", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=19", "text": "simple"}}, {"token": "version", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=19", "text": "simple"}}, {"token": "hword_numpart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=19", "text": "simple"}}, {"token": "hword_part", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=19", "text": "simple"}}, {"token": "hword_asciipart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=19", "text": "simple"}}, {"token": "numhword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=19", "text": "simple"}}, {"token": "asciihword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=19", "text": "simple"}}, {"token": "hword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=19", "text": "simple"}}, {"token": "url_path", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=19", "text": "simple"}}, {"token": "file", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=19", "text": "simple"}}, {"token": "float", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=19", "text": "simple"}}, {"token": "int", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=19", "text": "simple"}}, {"token": "uint", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=19", "text": "simple"}}], "title": "Token-to-dictionary mappings", "columns": [{"key": "token", "label": "Token type"}, {"key": "sequence", "label": "Order"}, {"key": "dictionary", "label": "Dictionary"}]}], "aliases": [], "related": [{"url": "/wiki/fts/parser-default/?v=19", "label": "default parser"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v19beta4/postgresql-19beta4.tar.bz2", "label": "19beta4", "major": "19", "channel": "preview", "revision": "83157ee9c599d03b2f7a3d73ef3a56ec24e0e79cc2b3501a64d1364f56398c86", "source_sha256": "83157ee9c599d03b2f7a3d73ef3a56ec24e0e79cc2b3501a64d1364f56398c86", "catalog_fingerprint": "62fbf1a3689dbe8bf7e6b3372cfe6fbf867581427b3858a94c8419b77a4d2d1d"}, "sources": [{"url": "https://ftp.postgresql.org/pub/source/v19beta4/postgresql-19beta4.tar.bz2", "label": "Matching PostgreSQL source archive", "sha256": "83157ee9c599d03b2f7a3d73ef3a56ec24e0e79cc2b3501a64d1364f56398c86"}, {"url": "/docs/19/textsearch-configuration.html", "path": "textsearch-configuration.html", "label": "PostgreSQL 19 English manual", "sha256": "89d047816e375228f2d4567d524efa447b563a1cd55e9fdf53481f0ab4ca1203"}], "mappings": [{"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}], "sections": [], "signature": "", "attributes": {"parser": "default", "configuration": "simple"}, "description": ["Text search configuration simple."], "manual_html": "<div class=\"sect1\" id=\"TEXTSEARCH-CONFIGURATION\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\">12.7.\u00a0Configuration Example </h2>\n</div>\n</div>\n</div>\n<p>A text search configuration specifies all options necessary to transform a document into a <code class=\"type\">tsvector</code>: the parser to use to break text into tokens, and the dictionaries to use to transform each token into a lexeme. Every call of <code class=\"function\">to_tsvector</code> or <code class=\"function\">to_tsquery</code> needs a text search configuration to perform its processing. The configuration parameter <a class=\"xref\" href=\"/docs/19/runtime-config-client.html#GUC-DEFAULT-TEXT-SEARCH-CONFIG\">default_text_search_config</a> specifies the name of the default configuration, which is the one used by text search functions if an explicit configuration parameter is omitted. It can be set in <code class=\"filename\">postgresql.conf</code>, or set for an individual session using the <code class=\"command\">SET</code> command.</p>\n<p>Several predefined text search configurations are available, and you can create custom configurations easily. To facilitate management of text search objects, a set of SQL commands is available, and there are several <span class=\"application\">psql</span> commands that display information about text search objects (<a class=\"xref\" href=\"/docs/19/textsearch-psql.html\" title=\"12.10.\u00a0psql Support\">Section\u00a012.10</a>).</p>\n<p>As an example we will create a configuration <code class=\"literal\">pg</code>, starting by duplicating the built-in <code class=\"literal\">english</code> configuration:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH CONFIGURATION public.pg ( COPY = pg_catalog.english );\n</pre>\n<p>We will use a PostgreSQL-specific synonym list and store it in <code class=\"filename\">$SHAREDIR/tsearch_data/pg_dict.syn</code>. The file contents look like:</p>\n<pre class=\"programlisting\">postgres    pg\npgsql       pg\npostgresql  pg\n</pre>\n<p>We define the synonym dictionary like this:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY pg_dict (\n    TEMPLATE = synonym,\n    SYNONYMS = pg_dict\n);\n</pre>\n<p>Next we register the <span class=\"productname\">Ispell</span> dictionary <code class=\"literal\">english_ispell</code>, which has its own configuration files:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY english_ispell (\n    TEMPLATE = ispell,\n    DictFile = english,\n    AffFile = english,\n    StopWords = english\n);\n</pre>\n<p>Now we can set up the mappings for words in configuration <code class=\"literal\">pg</code>:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    ALTER MAPPING FOR asciiword, asciihword, hword_asciipart,\n                      word, hword, hword_part\n    WITH pg_dict, english_ispell, english_stem;\n</pre>\n<p>We choose not to index or search some token types that the built-in configuration does handle:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    DROP MAPPING FOR email, url, url_path, sfloat, float;\n</pre>\n<p>Now we can test our configuration:</p>\n<pre class=\"programlisting\">SELECT * FROM ts_debug('public.pg', '\nPostgreSQL, the highly scalable, SQL compliant, open source object-relational\ndatabase management system, is now undergoing beta testing of the next\nversion of our software.\n');\n</pre>\n<p>The next step is to set the session to use the new configuration, which was created in the <code class=\"literal\">public</code> schema:</p>\n<pre class=\"screen\">=&gt; \\dF\n   List of text search configurations\n Schema  | Name | Description\n---------+------+-------------\n public  | pg   |\n\nSET default_text_search_config = 'public.pg';\nSET\n\nSHOW default_text_search_config;\n default_text_search_config\n----------------------------\n public.pg\n</pre>\n</div>", "manual_path": "/docs/19/textsearch-configuration.html", "comparison_data": {"parser": "default", "mappings": [{"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}]}, "comparison_hash": "840bafee949b0879fa51f540c9c5008d0b8be549c086d4d01dcbffc221deafa1"}, "20": {"facts": [{"label": "Configuration", "value": "simple"}, {"label": "Parser", "value": "default"}], "tables": [{"key": "mappings", "rows": [{"token": "asciiword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=20", "text": "simple"}}, {"token": "word", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=20", "text": "simple"}}, {"token": "numword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=20", "text": "simple"}}, {"token": "email", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=20", "text": "simple"}}, {"token": "url", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=20", "text": "simple"}}, {"token": "host", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=20", "text": "simple"}}, {"token": "sfloat", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=20", "text": "simple"}}, {"token": "version", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=20", "text": "simple"}}, {"token": "hword_numpart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=20", "text": "simple"}}, {"token": "hword_part", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=20", "text": "simple"}}, {"token": "hword_asciipart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=20", "text": "simple"}}, {"token": "numhword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=20", "text": "simple"}}, {"token": "asciihword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=20", "text": "simple"}}, {"token": "hword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=20", "text": "simple"}}, {"token": "url_path", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=20", "text": "simple"}}, {"token": "file", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=20", "text": "simple"}}, {"token": "float", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=20", "text": "simple"}}, {"token": "int", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=20", "text": "simple"}}, {"token": "uint", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=20", "text": "simple"}}], "title": "Token-to-dictionary mappings", "columns": [{"key": "token", "label": "Token type"}, {"key": "sequence", "label": "Order"}, {"key": "dictionary", "label": "Dictionary"}]}], "aliases": [], "related": [{"url": "/wiki/fts/parser-default/?v=20", "label": "default parser"}], "release": {"ref": "https://ftp.postgresql.org/pub/snapshot/dev/postgresql-snapshot.tar.bz2", "label": "20devel", "major": "20", "channel": "devel", "revision": "4d3346909b201ac1648232cf290462a7070c119326f56196f1f0253ed80fae41", "source_sha256": "4d3346909b201ac1648232cf290462a7070c119326f56196f1f0253ed80fae41", "catalog_fingerprint": "398fbb9f262264053c02fbf79f88be0a6770c1473faa6ecd5931d6ec41b8258b", "source_snapshot_utc": "26-Sep-2026 20:22"}, "sources": [{"url": "https://ftp.postgresql.org/pub/snapshot/dev/postgresql-snapshot.tar.bz2", "label": "Matching PostgreSQL source archive", "sha256": "4d3346909b201ac1648232cf290462a7070c119326f56196f1f0253ed80fae41"}, {"url": "/docs/devel/textsearch-configuration.html", "path": "textsearch-configuration.html", "label": "PostgreSQL 20 English manual", "sha256": "103fb0b6b1d46249a247532a5687300b13971bf4e52ffa6c3ca1bd71c4427d50"}], "mappings": [{"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}], "sections": [], "signature": "", "attributes": {"parser": "default", "configuration": "simple"}, "description": ["Text search configuration simple."], "manual_html": "<div class=\"sect1\" id=\"TEXTSEARCH-CONFIGURATION\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\">12.7.\u00a0Configuration Example </h2>\n</div>\n</div>\n</div>\n<p>A text search configuration specifies all options necessary to transform a document into a <code class=\"type\">tsvector</code>: the parser to use to break text into tokens, and the dictionaries to use to transform each token into a lexeme. Every call of <code class=\"function\">to_tsvector</code> or <code class=\"function\">to_tsquery</code> needs a text search configuration to perform its processing. The configuration parameter <a class=\"xref\" href=\"/docs/devel/runtime-config-client.html#GUC-DEFAULT-TEXT-SEARCH-CONFIG\">default_text_search_config</a> specifies the name of the default configuration, which is the one used by text search functions if an explicit configuration parameter is omitted. It can be set in <code class=\"filename\">postgresql.conf</code>, or set for an individual session using the <code class=\"command\">SET</code> command.</p>\n<p>Several predefined text search configurations are available, and you can create custom configurations easily. To facilitate management of text search objects, a set of SQL commands is available, and there are several <span class=\"application\">psql</span> commands that display information about text search objects (<a class=\"xref\" href=\"/docs/devel/textsearch-psql.html\" title=\"12.10.\u00a0psql Support\">Section\u00a012.10</a>).</p>\n<p>As an example we will create a configuration <code class=\"literal\">pg</code>, starting by duplicating the built-in <code class=\"literal\">english</code> configuration:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH CONFIGURATION public.pg ( COPY = pg_catalog.english );\n</pre>\n<p>We will use a PostgreSQL-specific synonym list and store it in <code class=\"filename\">$SHAREDIR/tsearch_data/pg_dict.syn</code>. The file contents look like:</p>\n<pre class=\"programlisting\">postgres    pg\npgsql       pg\npostgresql  pg\n</pre>\n<p>We define the synonym dictionary like this:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY pg_dict (\n    TEMPLATE = synonym,\n    SYNONYMS = pg_dict\n);\n</pre>\n<p>Next we register the <span class=\"productname\">Ispell</span> dictionary <code class=\"literal\">english_ispell</code>, which has its own configuration files:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY english_ispell (\n    TEMPLATE = ispell,\n    DictFile = english,\n    AffFile = english,\n    StopWords = english\n);\n</pre>\n<p>Now we can set up the mappings for words in configuration <code class=\"literal\">pg</code>:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    ALTER MAPPING FOR asciiword, asciihword, hword_asciipart,\n                      word, hword, hword_part\n    WITH pg_dict, english_ispell, english_stem;\n</pre>\n<p>We choose not to index or search some token types that the built-in configuration does handle:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    DROP MAPPING FOR email, url, url_path, sfloat, float;\n</pre>\n<p>Now we can test our configuration:</p>\n<pre class=\"programlisting\">SELECT * FROM ts_debug('public.pg', '\nPostgreSQL, the highly scalable, SQL compliant, open source object-relational\ndatabase management system, is now undergoing beta testing of the next\nversion of our software.\n');\n</pre>\n<p>The next step is to set the session to use the new configuration, which was created in the <code class=\"literal\">public</code> schema:</p>\n<pre class=\"screen\">=&gt; \\dF\n   List of text search configurations\n Schema  | Name | Description\n---------+------+-------------\n public  | pg   |\n\nSET default_text_search_config = 'public.pg';\nSET\n\nSHOW default_text_search_config;\n default_text_search_config\n----------------------------\n public.pg\n</pre>\n</div>", "manual_path": "/docs/devel/textsearch-configuration.html", "comparison_data": {"parser": "default", "mappings": [{"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}]}, "comparison_hash": "840bafee949b0879fa51f540c9c5008d0b8be549c086d4d01dcbffc221deafa1"}}}, "snapshot": {"facts": [{"label": "Configuration", "value": "simple"}, {"label": "Parser", "value": "default"}], "tables": [{"key": "mappings", "rows": [{"token": "asciiword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "word", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "numword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "email", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "url", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "host", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "sfloat", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "version", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "hword_numpart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "hword_part", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "hword_asciipart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "numhword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "asciihword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "hword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "url_path", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "file", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "float", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "int", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "uint", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}], "title": "Token-to-dictionary mappings", "columns": [{"key": "token", "label": "Token type"}, {"key": "sequence", "label": "Order"}, {"key": "dictionary", "label": "Dictionary"}]}], "aliases": [], "related": [{"url": "/wiki/fts/parser-default/?v=18", "label": "default parser"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "label": "18.6", "major": "18", "channel": "stable", "revision": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f", "source_sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f", "catalog_fingerprint": "65c93d6048ef30e61023a84f9680fa6a92b1c383b7eb226741170077eb078502"}, "sources": [{"url": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "label": "Matching PostgreSQL source archive", "sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}, {"url": "/docs/18/textsearch-configuration.html", "path": "textsearch-configuration.html", "label": "PostgreSQL 18 English manual", "sha256": "7957c03871a5f267f642ec609b2e3d1404eb000ccdef21ca0d1d8a8616110dc9"}], "mappings": [{"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}], "sections": [], "signature": "", "attributes": {"parser": "default", "configuration": "simple"}, "description": ["Text search configuration simple."], "manual_html": "<div class=\"sect1\" id=\"TEXTSEARCH-CONFIGURATION\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\">12.7.\u00a0Configuration Example </h2>\n</div>\n</div>\n</div>\n<p>A text search configuration specifies all options necessary to transform a document into a <code class=\"type\">tsvector</code>: the parser to use to break text into tokens, and the dictionaries to use to transform each token into a lexeme. Every call of <code class=\"function\">to_tsvector</code> or <code class=\"function\">to_tsquery</code> needs a text search configuration to perform its processing. The configuration parameter <a class=\"xref\" href=\"/docs/18/runtime-config-client.html#GUC-DEFAULT-TEXT-SEARCH-CONFIG\">default_text_search_config</a> specifies the name of the default configuration, which is the one used by text search functions if an explicit configuration parameter is omitted. It can be set in <code class=\"filename\">postgresql.conf</code>, or set for an individual session using the <code class=\"command\">SET</code> command.</p>\n<p>Several predefined text search configurations are available, and you can create custom configurations easily. To facilitate management of text search objects, a set of SQL commands is available, and there are several <span class=\"application\">psql</span> commands that display information about text search objects (<a class=\"xref\" href=\"/docs/18/textsearch-psql.html\" title=\"12.10.\u00a0psql Support\">Section\u00a012.10</a>).</p>\n<p>As an example we will create a configuration <code class=\"literal\">pg</code>, starting by duplicating the built-in <code class=\"literal\">english</code> configuration:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH CONFIGURATION public.pg ( COPY = pg_catalog.english );\n</pre>\n<p>We will use a PostgreSQL-specific synonym list and store it in <code class=\"filename\">$SHAREDIR/tsearch_data/pg_dict.syn</code>. The file contents look like:</p>\n<pre class=\"programlisting\">postgres    pg\npgsql       pg\npostgresql  pg\n</pre>\n<p>We define the synonym dictionary like this:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY pg_dict (\n    TEMPLATE = synonym,\n    SYNONYMS = pg_dict\n);\n</pre>\n<p>Next we register the <span class=\"productname\">Ispell</span> dictionary <code class=\"literal\">english_ispell</code>, which has its own configuration files:</p>\n<pre class=\"programlisting\">CREATE TEXT SEARCH DICTIONARY english_ispell (\n    TEMPLATE = ispell,\n    DictFile = english,\n    AffFile = english,\n    StopWords = english\n);\n</pre>\n<p>Now we can set up the mappings for words in configuration <code class=\"literal\">pg</code>:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    ALTER MAPPING FOR asciiword, asciihword, hword_asciipart,\n                      word, hword, hword_part\n    WITH pg_dict, english_ispell, english_stem;\n</pre>\n<p>We choose not to index or search some token types that the built-in configuration does handle:</p>\n<pre class=\"programlisting\">ALTER TEXT SEARCH CONFIGURATION pg\n    DROP MAPPING FOR email, url, url_path, sfloat, float;\n</pre>\n<p>Now we can test our configuration:</p>\n<pre class=\"programlisting\">SELECT * FROM ts_debug('public.pg', '\nPostgreSQL, the highly scalable, SQL compliant, open source object-relational\ndatabase management system, is now undergoing beta testing of the next\nversion of our software.\n');\n</pre>\n<p>The next step is to set the session to use the new configuration, which was created in the <code class=\"literal\">public</code> schema:</p>\n<pre class=\"screen\">=&gt; \\dF\n   List of text search configurations\n Schema  | Name | Description\n---------+------+-------------\n public  | pg   |\n\nSET default_text_search_config = 'public.pg';\nSET\n\nSHOW default_text_search_config;\n default_text_search_config\n----------------------------\n public.pg\n</pre>\n</div>", "manual_path": "/docs/18/textsearch-configuration.html", "comparison_data": {"parser": "default", "mappings": [{"token": "asciihword", "sequence": "1", "dictionary": "simple"}, {"token": "asciiword", "sequence": "1", "dictionary": "simple"}, {"token": "email", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "hword", "sequence": "1", "dictionary": "simple"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "word", "sequence": "1", "dictionary": "simple"}]}, "comparison_hash": "840bafee949b0879fa51f540c9c5008d0b8be549c086d4d01dcbffc221deafa1"}, "comparison": {"left": "17", "right": "18", "status": "unchanged", "diff": ""}}