{"kind": "fts", "major": "18", "item": {"slug": "configuration-hindi", "name": "hindi", "name_zh": "", "category": "Configurations", "summary": "Text search configuration hindi.", "aliases": [], "content_hash": "c219399280c0296a13ea2e1132c42b70fb037a8cbbb11d651883e941db9d511c", "versions": {"14": {"facts": [{"label": "Configuration", "value": "hindi"}, {"label": "Parser", "value": "default"}], "tables": [{"key": "mappings", "rows": [{"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": "url_path", "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": "file", "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": "sfloat", "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"}}, {"token": "numword", "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": "numhword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=14", "text": "simple"}}, {"token": "asciiword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=14", "text": "english_stem"}}, {"token": "hword_asciipart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=14", "text": "english_stem"}}, {"token": "asciihword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=14", "text": "english_stem"}}, {"token": "word", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=14", "text": "hindi_stem"}}, {"token": "hword_part", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=14", "text": "hindi_stem"}}, {"token": "hword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=14", "text": "hindi_stem"}}], "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": "email", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "asciiword", "sequence": "1", "dictionary": "english_stem"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "english_stem"}, {"token": "asciihword", "sequence": "1", "dictionary": "english_stem"}, {"token": "word", "sequence": "1", "dictionary": "hindi_stem"}, {"token": "hword_part", "sequence": "1", "dictionary": "hindi_stem"}, {"token": "hword", "sequence": "1", "dictionary": "hindi_stem"}], "sections": [{"code": "/*\n * text search configuration for hindi language\n *\n * Copyright (c) 2007-2021, PostgreSQL Global Development Group\n *\n * src/backend/snowball/snowball.sql.in\n *\n * hindi and certain other macros are replaced for each language;\n * see the Makefile for details.\n *\n * Note: this file is read in single-user -j mode, which means that the\n * command terminator is semicolon-newline-newline; whenever the backend\n * sees that, it stops and executes what it's got.  If you write a lot of\n * statements without empty lines between, they'll all get quoted to you\n * in any error message about one of them, so don't do that.  Also, you\n * cannot write a semicolon immediately followed by an empty line in a\n * string literal (including a function body!) or a multiline comment.\n */\n\nCREATE TEXT SEARCH DICTIONARY hindi_stem\n\t(TEMPLATE = snowball, Language = hindi );\n\nCOMMENT ON TEXT SEARCH DICTIONARY hindi_stem IS 'snowball stemmer for hindi language';\n\nCREATE TEXT SEARCH CONFIGURATION hindi\n\t(PARSER = default);\n\nCOMMENT ON TEXT SEARCH CONFIGURATION hindi IS 'configuration for hindi language';\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n\tFOR email, url, url_path, host, file, version,\n\t    sfloat, float, int, uint,\n\t    numword, hword_numpart, numhword\n\tWITH simple;\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n    FOR asciiword, hword_asciipart, asciihword\n\tWITH english_stem;\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n    FOR word, hword_part, hword\n\tWITH hindi_stem;", "title": "Generated initdb definition", "paragraphs": ["Generated from this release\u2019s Snowball language list and SQL template."]}], "signature": "", "attributes": {"parser": "default", "configuration": "hindi"}, "description": ["Text search configuration hindi."], "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": "english_stem"}, {"token": "asciiword", "sequence": "1", "dictionary": "english_stem"}, {"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": "hindi_stem"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "english_stem"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "hindi_stem"}, {"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": "hindi_stem"}]}, "comparison_hash": "1da519e116d482d8791c1c22dc0177d07cb1ee8d1bc93a810358f98623cf283b"}, "15": {"facts": [{"label": "Configuration", "value": "hindi"}, {"label": "Parser", "value": "default"}], "tables": [{"key": "mappings", "rows": [{"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": "url_path", "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": "file", "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": "sfloat", "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"}}, {"token": "numword", "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": "numhword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=15", "text": "simple"}}, {"token": "asciiword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=15", "text": "english_stem"}}, {"token": "hword_asciipart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=15", "text": "english_stem"}}, {"token": "asciihword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=15", "text": "english_stem"}}, {"token": "word", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=15", "text": "hindi_stem"}}, {"token": "hword_part", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=15", "text": "hindi_stem"}}, {"token": "hword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=15", "text": "hindi_stem"}}], "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": "email", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "asciiword", "sequence": "1", "dictionary": "english_stem"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "english_stem"}, {"token": "asciihword", "sequence": "1", "dictionary": "english_stem"}, {"token": "word", "sequence": "1", "dictionary": "hindi_stem"}, {"token": "hword_part", "sequence": "1", "dictionary": "hindi_stem"}, {"token": "hword", "sequence": "1", "dictionary": "hindi_stem"}], "sections": [{"code": "/*\n * text search configuration for hindi language\n *\n * Copyright (c) 2007-2022, PostgreSQL Global Development Group\n *\n * src/backend/snowball/snowball.sql.in\n *\n * hindi and certain other macros are replaced for each language;\n * see the Makefile for details.\n *\n * Note: this file is read in single-user -j mode, which means that the\n * command terminator is semicolon-newline-newline; whenever the backend\n * sees that, it stops and executes what it's got.  If you write a lot of\n * statements without empty lines between, they'll all get quoted to you\n * in any error message about one of them, so don't do that.  Also, you\n * cannot write a semicolon immediately followed by an empty line in a\n * string literal (including a function body!) or a multiline comment.\n */\n\nCREATE TEXT SEARCH DICTIONARY hindi_stem\n\t(TEMPLATE = snowball, Language = hindi );\n\nCOMMENT ON TEXT SEARCH DICTIONARY hindi_stem IS 'snowball stemmer for hindi language';\n\nCREATE TEXT SEARCH CONFIGURATION hindi\n\t(PARSER = default);\n\nCOMMENT ON TEXT SEARCH CONFIGURATION hindi IS 'configuration for hindi language';\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n\tFOR email, url, url_path, host, file, version,\n\t    sfloat, float, int, uint,\n\t    numword, hword_numpart, numhword\n\tWITH simple;\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n    FOR asciiword, hword_asciipart, asciihword\n\tWITH english_stem;\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n    FOR word, hword_part, hword\n\tWITH hindi_stem;", "title": "Generated initdb definition", "paragraphs": ["Generated from this release\u2019s Snowball language list and SQL template."]}], "signature": "", "attributes": {"parser": "default", "configuration": "hindi"}, "description": ["Text search configuration hindi."], "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": "english_stem"}, {"token": "asciiword", "sequence": "1", "dictionary": "english_stem"}, {"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": "hindi_stem"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "english_stem"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "hindi_stem"}, {"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": "hindi_stem"}]}, "comparison_hash": "1da519e116d482d8791c1c22dc0177d07cb1ee8d1bc93a810358f98623cf283b"}, "16": {"facts": [{"label": "Configuration", "value": "hindi"}, {"label": "Parser", "value": "default"}], "tables": [{"key": "mappings", "rows": [{"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": "url_path", "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": "file", "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": "sfloat", "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"}}, {"token": "numword", "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": "numhword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=16", "text": "simple"}}, {"token": "asciiword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=16", "text": "english_stem"}}, {"token": "hword_asciipart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=16", "text": "english_stem"}}, {"token": "asciihword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=16", "text": "english_stem"}}, {"token": "word", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=16", "text": "hindi_stem"}}, {"token": "hword_part", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=16", "text": "hindi_stem"}}, {"token": "hword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=16", "text": "hindi_stem"}}], "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": "email", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "asciiword", "sequence": "1", "dictionary": "english_stem"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "english_stem"}, {"token": "asciihword", "sequence": "1", "dictionary": "english_stem"}, {"token": "word", "sequence": "1", "dictionary": "hindi_stem"}, {"token": "hword_part", "sequence": "1", "dictionary": "hindi_stem"}, {"token": "hword", "sequence": "1", "dictionary": "hindi_stem"}], "sections": [{"code": "/*\n * text search configuration for hindi language\n *\n * Copyright (c) 2007-2023, PostgreSQL Global Development Group\n *\n * src/backend/snowball/snowball.sql.in\n *\n * hindi and certain other macros are replaced for each language;\n * see the Makefile for details.\n *\n * Note: this file is read in single-user -j mode, which means that the\n * command terminator is semicolon-newline-newline; whenever the backend\n * sees that, it stops and executes what it's got.  If you write a lot of\n * statements without empty lines between, they'll all get quoted to you\n * in any error message about one of them, so don't do that.  Also, you\n * cannot write a semicolon immediately followed by an empty line in a\n * string literal (including a function body!) or a multiline comment.\n */\n\nCREATE TEXT SEARCH DICTIONARY hindi_stem\n\t(TEMPLATE = snowball, Language = hindi );\n\nCOMMENT ON TEXT SEARCH DICTIONARY hindi_stem IS 'snowball stemmer for hindi language';\n\nCREATE TEXT SEARCH CONFIGURATION hindi\n\t(PARSER = default);\n\nCOMMENT ON TEXT SEARCH CONFIGURATION hindi IS 'configuration for hindi language';\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n\tFOR email, url, url_path, host, file, version,\n\t    sfloat, float, int, uint,\n\t    numword, hword_numpart, numhword\n\tWITH simple;\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n    FOR asciiword, hword_asciipart, asciihword\n\tWITH english_stem;\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n    FOR word, hword_part, hword\n\tWITH hindi_stem;", "title": "Generated initdb definition", "paragraphs": ["Generated from this release\u2019s Snowball language list and SQL template."]}], "signature": "", "attributes": {"parser": "default", "configuration": "hindi"}, "description": ["Text search configuration hindi."], "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": "english_stem"}, {"token": "asciiword", "sequence": "1", "dictionary": "english_stem"}, {"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": "hindi_stem"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "english_stem"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "hindi_stem"}, {"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": "hindi_stem"}]}, "comparison_hash": "1da519e116d482d8791c1c22dc0177d07cb1ee8d1bc93a810358f98623cf283b"}, "17": {"facts": [{"label": "Configuration", "value": "hindi"}, {"label": "Parser", "value": "default"}], "tables": [{"key": "mappings", "rows": [{"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": "url_path", "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": "file", "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": "sfloat", "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"}}, {"token": "numword", "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": "numhword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=17", "text": "simple"}}, {"token": "asciiword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=17", "text": "english_stem"}}, {"token": "hword_asciipart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=17", "text": "english_stem"}}, {"token": "asciihword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=17", "text": "english_stem"}}, {"token": "word", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=17", "text": "hindi_stem"}}, {"token": "hword_part", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=17", "text": "hindi_stem"}}, {"token": "hword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=17", "text": "hindi_stem"}}], "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": "email", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "asciiword", "sequence": "1", "dictionary": "english_stem"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "english_stem"}, {"token": "asciihword", "sequence": "1", "dictionary": "english_stem"}, {"token": "word", "sequence": "1", "dictionary": "hindi_stem"}, {"token": "hword_part", "sequence": "1", "dictionary": "hindi_stem"}, {"token": "hword", "sequence": "1", "dictionary": "hindi_stem"}], "sections": [{"code": "/*\n * text search configuration for hindi language\n *\n * Copyright (c) 2007-2024, PostgreSQL Global Development Group\n *\n * src/backend/snowball/snowball.sql.in\n *\n * hindi and certain other macros are replaced for each language;\n * see the Makefile for details.\n *\n * Note: this file is read in single-user -j mode, which means that the\n * command terminator is semicolon-newline-newline; whenever the backend\n * sees that, it stops and executes what it's got.  If you write a lot of\n * statements without empty lines between, they'll all get quoted to you\n * in any error message about one of them, so don't do that.  Also, you\n * cannot write a semicolon immediately followed by an empty line in a\n * string literal (including a function body!) or a multiline comment.\n */\n\nCREATE TEXT SEARCH DICTIONARY hindi_stem\n\t(TEMPLATE = snowball, Language = hindi );\n\nCOMMENT ON TEXT SEARCH DICTIONARY hindi_stem IS 'snowball stemmer for hindi language';\n\nCREATE TEXT SEARCH CONFIGURATION hindi\n\t(PARSER = default);\n\nCOMMENT ON TEXT SEARCH CONFIGURATION hindi IS 'configuration for hindi language';\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n\tFOR email, url, url_path, host, file, version,\n\t    sfloat, float, int, uint,\n\t    numword, hword_numpart, numhword\n\tWITH simple;\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n    FOR asciiword, hword_asciipart, asciihword\n\tWITH english_stem;\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n    FOR word, hword_part, hword\n\tWITH hindi_stem;", "title": "Generated initdb definition", "paragraphs": ["Generated from this release\u2019s Snowball language list and SQL template."]}], "signature": "", "attributes": {"parser": "default", "configuration": "hindi"}, "description": ["Text search configuration hindi."], "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": "english_stem"}, {"token": "asciiword", "sequence": "1", "dictionary": "english_stem"}, {"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": "hindi_stem"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "english_stem"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "hindi_stem"}, {"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": "hindi_stem"}]}, "comparison_hash": "1da519e116d482d8791c1c22dc0177d07cb1ee8d1bc93a810358f98623cf283b"}, "18": {"facts": [{"label": "Configuration", "value": "hindi"}, {"label": "Parser", "value": "default"}], "tables": [{"key": "mappings", "rows": [{"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": "url_path", "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": "file", "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": "sfloat", "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"}}, {"token": "numword", "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": "numhword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "asciiword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=18", "text": "english_stem"}}, {"token": "hword_asciipart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=18", "text": "english_stem"}}, {"token": "asciihword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=18", "text": "english_stem"}}, {"token": "word", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=18", "text": "hindi_stem"}}, {"token": "hword_part", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=18", "text": "hindi_stem"}}, {"token": "hword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=18", "text": "hindi_stem"}}], "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": "email", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "asciiword", "sequence": "1", "dictionary": "english_stem"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "english_stem"}, {"token": "asciihword", "sequence": "1", "dictionary": "english_stem"}, {"token": "word", "sequence": "1", "dictionary": "hindi_stem"}, {"token": "hword_part", "sequence": "1", "dictionary": "hindi_stem"}, {"token": "hword", "sequence": "1", "dictionary": "hindi_stem"}], "sections": [{"code": "/*\n * text search configuration for hindi language\n *\n * Copyright (c) 2007-2025, PostgreSQL Global Development Group\n *\n * src/backend/snowball/snowball.sql.in\n *\n * hindi and certain other macros are replaced for each language;\n * see the Makefile for details.\n *\n * Note: this file is read in single-user -j mode, which means that the\n * command terminator is semicolon-newline-newline; whenever the backend\n * sees that, it stops and executes what it's got.  If you write a lot of\n * statements without empty lines between, they'll all get quoted to you\n * in any error message about one of them, so don't do that.  Also, you\n * cannot write a semicolon immediately followed by an empty line in a\n * string literal (including a function body!) or a multiline comment.\n */\n\nCREATE TEXT SEARCH DICTIONARY hindi_stem\n\t(TEMPLATE = snowball, Language = hindi );\n\nCOMMENT ON TEXT SEARCH DICTIONARY hindi_stem IS 'snowball stemmer for hindi language';\n\nCREATE TEXT SEARCH CONFIGURATION hindi\n\t(PARSER = default);\n\nCOMMENT ON TEXT SEARCH CONFIGURATION hindi IS 'configuration for hindi language';\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n\tFOR email, url, url_path, host, file, version,\n\t    sfloat, float, int, uint,\n\t    numword, hword_numpart, numhword\n\tWITH simple;\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n    FOR asciiword, hword_asciipart, asciihword\n\tWITH english_stem;\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n    FOR word, hword_part, hword\n\tWITH hindi_stem;", "title": "Generated initdb definition", "paragraphs": ["Generated from this release\u2019s Snowball language list and SQL template."]}], "signature": "", "attributes": {"parser": "default", "configuration": "hindi"}, "description": ["Text search configuration hindi."], "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": "english_stem"}, {"token": "asciiword", "sequence": "1", "dictionary": "english_stem"}, {"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": "hindi_stem"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "english_stem"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "hindi_stem"}, {"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": "hindi_stem"}]}, "comparison_hash": "1da519e116d482d8791c1c22dc0177d07cb1ee8d1bc93a810358f98623cf283b"}, "19": {"facts": [{"label": "Configuration", "value": "hindi"}, {"label": "Parser", "value": "default"}], "tables": [{"key": "mappings", "rows": [{"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": "url_path", "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": "file", "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": "sfloat", "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"}}, {"token": "numword", "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": "numhword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=19", "text": "simple"}}, {"token": "asciiword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=19", "text": "english_stem"}}, {"token": "hword_asciipart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=19", "text": "english_stem"}}, {"token": "asciihword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=19", "text": "english_stem"}}, {"token": "word", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=19", "text": "hindi_stem"}}, {"token": "hword_part", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=19", "text": "hindi_stem"}}, {"token": "hword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=19", "text": "hindi_stem"}}], "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": "email", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "asciiword", "sequence": "1", "dictionary": "english_stem"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "english_stem"}, {"token": "asciihword", "sequence": "1", "dictionary": "english_stem"}, {"token": "word", "sequence": "1", "dictionary": "hindi_stem"}, {"token": "hword_part", "sequence": "1", "dictionary": "hindi_stem"}, {"token": "hword", "sequence": "1", "dictionary": "hindi_stem"}], "sections": [{"code": "/*\n * text search configuration for hindi language\n *\n * Copyright (c) 2007-2026, PostgreSQL Global Development Group\n *\n * src/backend/snowball/snowball.sql.in\n *\n * hindi and certain other macros are replaced for each language;\n * see the Makefile for details.\n *\n * Note: this file is read in single-user -j mode, which means that the\n * command terminator is semicolon-newline-newline; whenever the backend\n * sees that, it stops and executes what it's got.  If you write a lot of\n * statements without empty lines between, they'll all get quoted to you\n * in any error message about one of them, so don't do that.  Also, you\n * cannot write a semicolon immediately followed by an empty line in a\n * string literal (including a function body!) or a multiline comment.\n */\n\nCREATE TEXT SEARCH DICTIONARY hindi_stem\n\t(TEMPLATE = snowball, Language = hindi );\n\nCOMMENT ON TEXT SEARCH DICTIONARY hindi_stem IS 'snowball stemmer for hindi language';\n\nCREATE TEXT SEARCH CONFIGURATION hindi\n\t(PARSER = default);\n\nCOMMENT ON TEXT SEARCH CONFIGURATION hindi IS 'configuration for hindi language';\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n\tFOR email, url, url_path, host, file, version,\n\t    sfloat, float, int, uint,\n\t    numword, hword_numpart, numhword\n\tWITH simple;\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n    FOR asciiword, hword_asciipart, asciihword\n\tWITH english_stem;\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n    FOR word, hword_part, hword\n\tWITH hindi_stem;", "title": "Generated initdb definition", "paragraphs": ["Generated from this release\u2019s Snowball language list and SQL template."]}], "signature": "", "attributes": {"parser": "default", "configuration": "hindi"}, "description": ["Text search configuration hindi."], "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": "english_stem"}, {"token": "asciiword", "sequence": "1", "dictionary": "english_stem"}, {"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": "hindi_stem"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "english_stem"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "hindi_stem"}, {"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": "hindi_stem"}]}, "comparison_hash": "1da519e116d482d8791c1c22dc0177d07cb1ee8d1bc93a810358f98623cf283b"}, "20": {"facts": [{"label": "Configuration", "value": "hindi"}, {"label": "Parser", "value": "default"}], "tables": [{"key": "mappings", "rows": [{"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": "url_path", "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": "file", "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": "sfloat", "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"}}, {"token": "numword", "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": "numhword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=20", "text": "simple"}}, {"token": "asciiword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=20", "text": "english_stem"}}, {"token": "hword_asciipart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=20", "text": "english_stem"}}, {"token": "asciihword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=20", "text": "english_stem"}}, {"token": "word", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=20", "text": "hindi_stem"}}, {"token": "hword_part", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=20", "text": "hindi_stem"}}, {"token": "hword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=20", "text": "hindi_stem"}}], "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": "email", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "asciiword", "sequence": "1", "dictionary": "english_stem"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "english_stem"}, {"token": "asciihword", "sequence": "1", "dictionary": "english_stem"}, {"token": "word", "sequence": "1", "dictionary": "hindi_stem"}, {"token": "hword_part", "sequence": "1", "dictionary": "hindi_stem"}, {"token": "hword", "sequence": "1", "dictionary": "hindi_stem"}], "sections": [{"code": "/*\n * text search configuration for hindi language\n *\n * Copyright (c) 2007-2026, PostgreSQL Global Development Group\n *\n * src/backend/snowball/snowball.sql.in\n *\n * hindi and certain other macros are replaced for each language;\n * see the Makefile for details.\n *\n * Note: this file is read in single-user -j mode, which means that the\n * command terminator is semicolon-newline-newline; whenever the backend\n * sees that, it stops and executes what it's got.  If you write a lot of\n * statements without empty lines between, they'll all get quoted to you\n * in any error message about one of them, so don't do that.  Also, you\n * cannot write a semicolon immediately followed by an empty line in a\n * string literal (including a function body!) or a multiline comment.\n */\n\nCREATE TEXT SEARCH DICTIONARY hindi_stem\n\t(TEMPLATE = snowball, Language = hindi );\n\nCOMMENT ON TEXT SEARCH DICTIONARY hindi_stem IS 'snowball stemmer for hindi language';\n\nCREATE TEXT SEARCH CONFIGURATION hindi\n\t(PARSER = default);\n\nCOMMENT ON TEXT SEARCH CONFIGURATION hindi IS 'configuration for hindi language';\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n\tFOR email, url, url_path, host, file, version,\n\t    sfloat, float, int, uint,\n\t    numword, hword_numpart, numhword\n\tWITH simple;\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n    FOR asciiword, hword_asciipart, asciihword\n\tWITH english_stem;\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n    FOR word, hword_part, hword\n\tWITH hindi_stem;", "title": "Generated initdb definition", "paragraphs": ["Generated from this release\u2019s Snowball language list and SQL template."]}], "signature": "", "attributes": {"parser": "default", "configuration": "hindi"}, "description": ["Text search configuration hindi."], "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": "english_stem"}, {"token": "asciiword", "sequence": "1", "dictionary": "english_stem"}, {"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": "hindi_stem"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "english_stem"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "hindi_stem"}, {"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": "hindi_stem"}]}, "comparison_hash": "1da519e116d482d8791c1c22dc0177d07cb1ee8d1bc93a810358f98623cf283b"}}}, "snapshot": {"facts": [{"label": "Configuration", "value": "hindi"}, {"label": "Parser", "value": "default"}], "tables": [{"key": "mappings", "rows": [{"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": "url_path", "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": "file", "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": "sfloat", "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"}}, {"token": "numword", "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": "numhword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-simple/?v=18", "text": "simple"}}, {"token": "asciiword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=18", "text": "english_stem"}}, {"token": "hword_asciipart", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=18", "text": "english_stem"}}, {"token": "asciihword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-english_stem/?v=18", "text": "english_stem"}}, {"token": "word", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=18", "text": "hindi_stem"}}, {"token": "hword_part", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=18", "text": "hindi_stem"}}, {"token": "hword", "sequence": "1", "dictionary": {"url": "/wiki/fts/dictionary-hindi_stem/?v=18", "text": "hindi_stem"}}], "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": "email", "sequence": "1", "dictionary": "simple"}, {"token": "url", "sequence": "1", "dictionary": "simple"}, {"token": "url_path", "sequence": "1", "dictionary": "simple"}, {"token": "host", "sequence": "1", "dictionary": "simple"}, {"token": "file", "sequence": "1", "dictionary": "simple"}, {"token": "version", "sequence": "1", "dictionary": "simple"}, {"token": "sfloat", "sequence": "1", "dictionary": "simple"}, {"token": "float", "sequence": "1", "dictionary": "simple"}, {"token": "int", "sequence": "1", "dictionary": "simple"}, {"token": "uint", "sequence": "1", "dictionary": "simple"}, {"token": "numword", "sequence": "1", "dictionary": "simple"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "numhword", "sequence": "1", "dictionary": "simple"}, {"token": "asciiword", "sequence": "1", "dictionary": "english_stem"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "english_stem"}, {"token": "asciihword", "sequence": "1", "dictionary": "english_stem"}, {"token": "word", "sequence": "1", "dictionary": "hindi_stem"}, {"token": "hword_part", "sequence": "1", "dictionary": "hindi_stem"}, {"token": "hword", "sequence": "1", "dictionary": "hindi_stem"}], "sections": [{"code": "/*\n * text search configuration for hindi language\n *\n * Copyright (c) 2007-2025, PostgreSQL Global Development Group\n *\n * src/backend/snowball/snowball.sql.in\n *\n * hindi and certain other macros are replaced for each language;\n * see the Makefile for details.\n *\n * Note: this file is read in single-user -j mode, which means that the\n * command terminator is semicolon-newline-newline; whenever the backend\n * sees that, it stops and executes what it's got.  If you write a lot of\n * statements without empty lines between, they'll all get quoted to you\n * in any error message about one of them, so don't do that.  Also, you\n * cannot write a semicolon immediately followed by an empty line in a\n * string literal (including a function body!) or a multiline comment.\n */\n\nCREATE TEXT SEARCH DICTIONARY hindi_stem\n\t(TEMPLATE = snowball, Language = hindi );\n\nCOMMENT ON TEXT SEARCH DICTIONARY hindi_stem IS 'snowball stemmer for hindi language';\n\nCREATE TEXT SEARCH CONFIGURATION hindi\n\t(PARSER = default);\n\nCOMMENT ON TEXT SEARCH CONFIGURATION hindi IS 'configuration for hindi language';\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n\tFOR email, url, url_path, host, file, version,\n\t    sfloat, float, int, uint,\n\t    numword, hword_numpart, numhword\n\tWITH simple;\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n    FOR asciiword, hword_asciipart, asciihword\n\tWITH english_stem;\n\nALTER TEXT SEARCH CONFIGURATION hindi ADD MAPPING\n    FOR word, hword_part, hword\n\tWITH hindi_stem;", "title": "Generated initdb definition", "paragraphs": ["Generated from this release\u2019s Snowball language list and SQL template."]}], "signature": "", "attributes": {"parser": "default", "configuration": "hindi"}, "description": ["Text search configuration hindi."], "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": "english_stem"}, {"token": "asciiword", "sequence": "1", "dictionary": "english_stem"}, {"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": "hindi_stem"}, {"token": "hword_asciipart", "sequence": "1", "dictionary": "english_stem"}, {"token": "hword_numpart", "sequence": "1", "dictionary": "simple"}, {"token": "hword_part", "sequence": "1", "dictionary": "hindi_stem"}, {"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": "hindi_stem"}]}, "comparison_hash": "1da519e116d482d8791c1c22dc0177d07cb1ee8d1bc93a810358f98623cf283b"}, "comparison": {"left": "17", "right": "18", "status": "unchanged", "diff": ""}}