gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 satır
5.0KB

  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!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.11. dict_int</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 V1.79.1" /><link rel="prev" href="contrib-dblink-build-sql-update.html" title="dblink_build_sql_update" /><link rel="next" href="dict-xsyn.html" title="F.12. dict_xsyn" /></head><body><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">F.11. dict_int</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">Up</a></td><th width="60%" align="center">Appendix F. Additional Supplied Modules</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 12.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="dict-xsyn.html" title="F.12. dict_xsyn">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="DICT-INT"><div class="titlepage"><div><div><h2 class="title" style="clear: both">F.11. dict_int</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="dict-int.html#id-1.11.7.20.4">F.11.1. Configuration</a></span></dt><dt><span class="sect2"><a href="dict-int.html#id-1.11.7.20.5">F.11.2. Usage</a></span></dt></dl></div><a id="id-1.11.7.20.2" class="indexterm"></a><p>
  3. <code class="filename">dict_int</code> is an example of an add-on dictionary template
  4. for full-text search. The motivation for this example dictionary is to
  5. control the indexing of integers (signed and unsigned), allowing such
  6. numbers to be indexed while preventing excessive growth in the number of
  7. unique words, which greatly affects the performance of searching.
  8. </p><div class="sect2" id="id-1.11.7.20.4"><div class="titlepage"><div><div><h3 class="title">F.11.1. Configuration</h3></div></div></div><p>
  9. The dictionary accepts two options:
  10. </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
  11. The <code class="literal">maxlen</code> parameter specifies the maximum number of
  12. digits allowed in an integer word. The default value is 6.
  13. </p></li><li class="listitem"><p>
  14. The <code class="literal">rejectlong</code> parameter specifies whether an overlength
  15. integer should be truncated or ignored. If <code class="literal">rejectlong</code> is
  16. <code class="literal">false</code> (the default), the dictionary returns the first
  17. <code class="literal">maxlen</code> digits of the integer. If <code class="literal">rejectlong</code> is
  18. <code class="literal">true</code>, the dictionary treats an overlength integer as a stop
  19. word, so that it will not be indexed. Note that this also means that
  20. such an integer cannot be searched for.
  21. </p></li></ul></div></div><div class="sect2" id="id-1.11.7.20.5"><div class="titlepage"><div><div><h3 class="title">F.11.2. Usage</h3></div></div></div><p>
  22. Installing the <code class="literal">dict_int</code> extension creates a text search
  23. template <code class="literal">intdict_template</code> and a dictionary <code class="literal">intdict</code>
  24. based on it, with the default parameters. You can alter the
  25. parameters, for example
  26. </p><pre class="programlisting">
  27. mydb# ALTER TEXT SEARCH DICTIONARY intdict (MAXLEN = 4, REJECTLONG = true);
  28. ALTER TEXT SEARCH DICTIONARY
  29. </pre><p>
  30. or create new dictionaries based on the template.
  31. </p><p>
  32. To test the dictionary, you can try
  33. </p><pre class="programlisting">
  34. mydb# select ts_lexize('intdict', '12345678');
  35. ts_lexize
  36. -----------
  37. {123456}
  38. </pre><p>
  39. but real-world usage will involve including it in a text search
  40. configuration as described in <a class="xref" href="textsearch.html" title="Chapter 12. Full Text Search">Chapter 12</a>.
  41. That might look like this:
  42. </p><pre class="programlisting">
  43. ALTER TEXT SEARCH CONFIGURATION english
  44. ALTER MAPPING FOR int, uint WITH intdict;
  45. </pre><p>
  46. </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">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="contrib.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="dict-xsyn.html">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">Home</a></td><td width="40%" align="right" valign="top"> F.12. dict_xsyn</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1