diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 13:44:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 13:44:03 +0000 |
commit | 293913568e6a7a86fd1479e1cff8e2ecb58d6568 (patch) | |
tree | fc3b469a3ec5ab71b36ea97cc7aaddb838423a0c /doc/src/sgml/html/dict-int.html | |
parent | Initial commit. (diff) | |
download | postgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.tar.xz postgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.zip |
Adding upstream version 16.2.upstream/16.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'doc/src/sgml/html/dict-int.html')
-rw-r--r-- | doc/src/sgml/html/dict-int.html | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/doc/src/sgml/html/dict-int.html b/doc/src/sgml/html/dict-int.html new file mode 100644 index 0000000..45429f6 --- /dev/null +++ b/doc/src/sgml/html/dict-int.html @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>F.13. dict_int — example full-text search dictionary for integers</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="contrib-dblink-build-sql-update.html" title="dblink_build_sql_update" /><link rel="next" href="dict-xsyn.html" title="F.14. dict_xsyn — example synonym full-text search dictionary" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">F.13. dict_int — + example full-text search dictionary for integers</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="contrib-dblink-build-sql-update.html" title="dblink_build_sql_update">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="contrib.html" title="Appendix F. Additional Supplied Modules and Extensions">Up</a></td><th width="60%" align="center">Appendix F. Additional Supplied Modules and Extensions</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 16.2 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="dict-xsyn.html" title="F.14. dict_xsyn — example synonym full-text search dictionary">Next</a></td></tr></table><hr /></div><div class="sect1" id="DICT-INT"><div class="titlepage"><div><div><h2 class="title" style="clear: both">F.13. dict_int — + example full-text search dictionary for integers <a href="#DICT-INT" class="id_link">#</a></h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="dict-int.html#DICT-INT-CONFIG">F.13.1. Configuration</a></span></dt><dt><span class="sect2"><a href="dict-int.html#DICT-INT-USAGE">F.13.2. Usage</a></span></dt></dl></div><a id="id-1.11.7.23.2" class="indexterm"></a><p> + <code class="filename">dict_int</code> is an example of an add-on dictionary template + for full-text search. The motivation for this example dictionary is to + control the indexing of integers (signed and unsigned), allowing such + numbers to be indexed while preventing excessive growth in the number of + unique words, which greatly affects the performance of searching. + </p><p> + This module is considered <span class="quote">“<span class="quote">trusted</span>”</span>, that is, it can be + installed by non-superusers who have <code class="literal">CREATE</code> privilege + on the current database. + </p><div class="sect2" id="DICT-INT-CONFIG"><div class="titlepage"><div><div><h3 class="title">F.13.1. Configuration <a href="#DICT-INT-CONFIG" class="id_link">#</a></h3></div></div></div><p> + The dictionary accepts three options: + </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p> + The <code class="literal">maxlen</code> parameter specifies the maximum number of + digits allowed in an integer word. The default value is 6. + </p></li><li class="listitem"><p> + The <code class="literal">rejectlong</code> parameter specifies whether an overlength + integer should be truncated or ignored. If <code class="literal">rejectlong</code> is + <code class="literal">false</code> (the default), the dictionary returns the first + <code class="literal">maxlen</code> digits of the integer. If <code class="literal">rejectlong</code> is + <code class="literal">true</code>, the dictionary treats an overlength integer as a stop + word, so that it will not be indexed. Note that this also means that + such an integer cannot be searched for. + </p></li><li class="listitem"><p> + The <code class="literal">absval</code> parameter specifies whether leading + <span class="quote">“<span class="quote"><code class="literal">+</code></span>”</span> or <span class="quote">“<span class="quote"><code class="literal">-</code></span>”</span> + signs should be removed from integer words. The default + is <code class="literal">false</code>. When <code class="literal">true</code>, the sign is + removed before <code class="literal">maxlen</code> is applied. + </p></li></ul></div></div><div class="sect2" id="DICT-INT-USAGE"><div class="titlepage"><div><div><h3 class="title">F.13.2. Usage <a href="#DICT-INT-USAGE" class="id_link">#</a></h3></div></div></div><p> + Installing the <code class="literal">dict_int</code> extension creates a text search + template <code class="literal">intdict_template</code> and a dictionary <code class="literal">intdict</code> + based on it, with the default parameters. You can alter the + parameters, for example + +</p><pre class="programlisting"> +mydb# ALTER TEXT SEARCH DICTIONARY intdict (MAXLEN = 4, REJECTLONG = true); +ALTER TEXT SEARCH DICTIONARY +</pre><p> + + or create new dictionaries based on the template. + </p><p> + To test the dictionary, you can try + +</p><pre class="programlisting"> +mydb# select ts_lexize('intdict', '12345678'); + ts_lexize +----------- + {123456} +</pre><p> + + but real-world usage will involve including it in a text search + configuration as described in <a class="xref" href="textsearch.html" title="Chapter 12. Full Text Search">Chapter 12</a>. + That might look like this: + +</p><pre class="programlisting"> +ALTER TEXT SEARCH CONFIGURATION english + ALTER MAPPING FOR int, uint WITH intdict; +</pre><p> + + </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="contrib-dblink-build-sql-update.html" title="dblink_build_sql_update">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="contrib.html" title="Appendix F. Additional Supplied Modules and Extensions">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="dict-xsyn.html" title="F.14. dict_xsyn — example synonym full-text search dictionary">Next</a></td></tr><tr><td width="40%" align="left" valign="top">dblink_build_sql_update </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 16.2 Documentation">Home</a></td><td width="40%" align="right" valign="top"> F.14. dict_xsyn — example synonym full-text search dictionary</td></tr></table></div></body></html>
\ No newline at end of file |