]> granicus.if.org Git - postgresql/commitdiff
Document that text search comparisons happen after text search
authorBruce Momjian <bruce@momjian.us>
Sat, 19 Feb 2011 03:39:17 +0000 (22:39 -0500)
committerBruce Momjian <bruce@momjian.us>
Sat, 19 Feb 2011 03:39:52 +0000 (22:39 -0500)
configuration rules.

Erik Rijkers

doc/src/sgml/datatype.sgml

index 2bf411d9e22ef80256533a9f7894386061786d09..10f0e590d79646dceeb25aa5c3838937044b25dc 100644 (file)
@@ -3847,7 +3847,28 @@ SELECT 'super:*'::tsquery;
  'super':*
 </programlisting>
      This query will match any word in a <type>tsvector</> that begins
-     with <quote>super</>.
+     with <quote>super</>.  
+    </para>
+
+    <para>
+     Note that text search configuration processing happens before
+     comparisons, which means this comparison returns <literal>true</>:
+<programlisting>
+SELECT to_tsvector( 'postgraduate' ) @@ to_tsquery( 'postgres:*' );
+ ?column? 
+----------
+ t
+(1 row)
+</programlisting>
+     because <literal>postgres</> gets stemmed to <literal>postgr</>: 
+<programlisting>
+SELECT to_tsquery('postgres:*');
+ to_tsquery 
+------------
+ 'postgr':*
+(1 row)
+</programlisting>
+     which then matches <literal>postgraduate</>.
     </para>
 
     <para>