Home Explore Blog CI



postgresql

1st chunk of `doc/src/sgml/dict-xsyn.sgml`
3b098a9d124d8203d05d4a90b905bd2247e4c9b2389f9e2700000001000008ac
<!-- doc/src/sgml/dict-xsyn.sgml -->

<sect1 id="dict-xsyn" xreflabel="dict_xsyn">
 <title>dict_xsyn &mdash; example synonym full-text search dictionary</title>

 <indexterm zone="dict-xsyn">
  <primary>dict_xsyn</primary>
 </indexterm>

 <para>
  <filename>dict_xsyn</filename> (Extended Synonym Dictionary) is an example of an
  add-on dictionary template for full-text search.  This dictionary type
  replaces words with groups of their synonyms, and so makes it possible to
  search for a word using any of its synonyms.
 </para>

 <sect2 id="dict-xsyn-config">
  <title>Configuration</title>

  <para>
   A <literal>dict_xsyn</literal> dictionary accepts the following options:
  </para>
  <itemizedlist>
   <listitem>
    <para>
     <literal>matchorig</literal> controls whether the original word is accepted by
     the dictionary. Default is <literal>true</literal>.
    </para>
   </listitem>
   <listitem>
    <para>
     <literal>matchsynonyms</literal> controls whether the synonyms are
     accepted by the dictionary. Default is <literal>false</literal>.
    </para>
   </listitem>
   <listitem>
    <para>
     <literal>keeporig</literal> controls whether the original word is included in
     the dictionary's output. Default is <literal>true</literal>.
    </para>
   </listitem>
   <listitem>
    <para>
     <literal>keepsynonyms</literal> controls whether the synonyms are included in
     the dictionary's output. Default is <literal>true</literal>.
    </para>
   </listitem>
   <listitem>
    <para>
     <literal>rules</literal> is the base name of the file containing the list of
     synonyms.  This file must be stored in
     <filename>$SHAREDIR/tsearch_data/</filename> (where <literal>$SHAREDIR</literal> means
     the <productname>PostgreSQL</productname> installation's shared-data directory).
     Its name must end in <literal>.rules</literal> (which is not to be included in
     the <literal>rules</literal> parameter).
    </para>
   </listitem>
  </itemizedlist>
  <para>
   The rules file has the following format:
  </para>
  <itemizedlist>
   <listitem>
    <para>
     Each line represents a group of synonyms for a single word, which is
     given first on the line. Synonyms

Title: dict_xsyn: Example Synonym Full-Text Search Dictionary
Summary
The dict_xsyn dictionary is an example of an add-on dictionary template for full-text search, replacing words with groups of their synonyms to enable searching using any synonym, with configurable options such as matchorig, matchsynonyms, keeporig, and keepsynonyms.