Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit bda9dc7

Browse files
committed
Do some copy-editing on description of ts_headline().
1 parent 14a4f6f commit bda9dc7

File tree

1 file changed

+32
-26
lines changed

1 file changed

+32
-26
lines changed

doc/src/sgml/textsearch.sgml

+32-26
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/textsearch.sgml,v 1.48 2009/03/24 20:17:08 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/textsearch.sgml,v 1.49 2009/04/14 00:49:56 tgl Exp $ -->
22

33
<chapter id="textsearch">
44
<title id="textsearch-title">Full Text Search</title>
@@ -1082,7 +1082,8 @@ ORDER BY rank DESC LIMIT 10;
10821082
<para>
10831083
<literal>StartSel</>, <literal>StopSel</literal>: the strings with which
10841084
query words appearing in the document should be delimited to distinguish
1085-
them from other excerpted words.
1085+
them from other excerpted words. You must double-quote these strings
1086+
if they contain spaces or commas.
10861087
</para>
10871088
</listitem>
10881089
<listitem >
@@ -1095,70 +1096,75 @@ ORDER BY rank DESC LIMIT 10;
10951096
<para>
10961097
<literal>ShortWord</literal>: words of this length or less will be
10971098
dropped at the start and end of a headline. The default
1098-
value of three eliminates the English articles.
1099+
value of three eliminates common English articles.
10991100
</para>
11001101
</listitem>
11011102
<listitem>
11021103
<para>
1103-
<literal>MaxFragments</literal>: maximum number of text excerpts
1104-
or fragments that matches the query words. It also triggers a
1105-
different headline generation function than the default one. This
1106-
function finds text fragments with as many query words as possible and
1107-
stretches those fragments around the query words. As a result
1108-
query words are close to the middle of each fragment and have words on
1109-
each side. Each fragment will be of at most MaxWords and will not
1110-
have words of size less than or equal to ShortWord at the start or
1111-
end of a fragment. If all query words are not found in the document,
1112-
then a single fragment of MinWords will be displayed.
1104+
<literal>HighlightAll</literal>: Boolean flag; if
1105+
<literal>true</literal> the whole document will be used as the
1106+
headline, ignoring the preceding three parameters.
11131107
</para>
11141108
</listitem>
11151109
<listitem>
11161110
<para>
1117-
<literal>FragmentDelimiter</literal>: When more than one fragments are
1118-
displayed, then the fragments will be separated by this delimiter. This
1119-
option is effective only if MaxFragments is greater than 1 and there are
1120-
more than one fragments to be diplayed. This option has no effect on the
1121-
default headline generation function.
1111+
<literal>MaxFragments</literal>: maximum number of text excerpts
1112+
or fragments to display. The default value of zero selects a
1113+
non-fragment-oriented headline generation method. A value greater than
1114+
zero selects fragment-based headline generation. This method
1115+
finds text fragments with as many query words as possible and
1116+
stretches those fragments around the query words. As a result
1117+
query words are close to the middle of each fragment and have words on
1118+
each side. Each fragment will be of at most <literal>MaxWords</> and
1119+
words of length <literal>ShortWord</> or less are dropped at the start
1120+
and end of each fragment. If not all query words are found in the
1121+
document, then a single fragment of the first <literal>MinWords</>
1122+
in the document will be displayed.
11221123
</para>
11231124
</listitem>
11241125
<listitem>
11251126
<para>
1126-
<literal>HighlightAll</literal>: Boolean flag; if
1127-
<literal>true</literal> the whole document will be highlighted.
1127+
<literal>FragmentDelimiter</literal>: When more than one fragment is
1128+
displayed, the fragments will be separated by this string.
11281129
</para>
11291130
</listitem>
11301131
</itemizedlist>
11311132

11321133
Any unspecified options receive these defaults:
11331134

11341135
<programlisting>
1135-
StartSel=&lt;b&gt;, StopSel=&lt;/b&gt;, MaxFragments=0, FragmentDelimiter=" ... ", MaxWords=35, MinWords=15, ShortWord=3, HighlightAll=FALSE
1136+
StartSel=&lt;b&gt;, StopSel=&lt;/b&gt;,
1137+
MaxWords=35, MinWords=15, ShortWord=3, HighlightAll=FALSE,
1138+
MaxFragments=0, FragmentDelimiter=" ... "
11361139
</programlisting>
11371140
</para>
11381141

11391142
<para>
11401143
For example:
11411144

11421145
<programlisting>
1143-
SELECT ts_headline('english', 'The most common type of search
1146+
SELECT ts_headline('english',
1147+
'The most common type of search
11441148
is to find all documents containing given query terms
11451149
and return them in order of their similarity to the
1146-
query.', to_tsquery('query &amp; similarity'));
1150+
query.',
1151+
to_tsquery('query &amp; similarity'));
11471152
ts_headline
11481153
------------------------------------------------------------
1149-
given &lt;b&gt;query&lt;/b&gt; terms
1154+
containing given &lt;b&gt;query&lt;/b&gt; terms
11501155
and return them in order of their &lt;b&gt;similarity&lt;/b&gt; to the
11511156
&lt;b&gt;query&lt;/b&gt;.
11521157

1153-
SELECT ts_headline('english', 'The most common type of search
1158+
SELECT ts_headline('english',
1159+
'The most common type of search
11541160
is to find all documents containing given query terms
11551161
and return them in order of their similarity to the
11561162
query.',
11571163
to_tsquery('query &amp; similarity'),
11581164
'StartSel = &lt;, StopSel = &gt;');
11591165
ts_headline
11601166
-------------------------------------------------------
1161-
given &lt;query&gt; terms
1167+
containing given &lt;query&gt; terms
11621168
and return them in order of their &lt;similarity&gt; to the
11631169
&lt;query&gt;.
11641170
</programlisting>

0 commit comments

Comments
 (0)