Adjust example to reduce confusion between a tsvector column and
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 14 Nov 2007 23:48:55 +0000 (23:48 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 14 Nov 2007 23:48:55 +0000 (23:48 +0000)
an index, per Simon.

doc/src/sgml/textsearch.sgml

index 6d7d2c9a679330e3e387c67fb59c5c1a893e8c57..982d62a564bc429eee7bd29bedeb44b599d6981f 100644 (file)
@@ -538,15 +538,15 @@ CREATE INDEX pgweb_idx ON pgweb USING gin(to_tsvector('english', title || body))
     indexed when the other is <literal>NULL</>:
 
 <programlisting>
-ALTER TABLE pgweb ADD COLUMN textsearch_index tsvector;
-UPDATE pgweb SET textsearch_index =
+ALTER TABLE pgweb ADD COLUMN textsearchable_index_col tsvector;
+UPDATE pgweb SET textsearchable_index_col =
      to_tsvector('english', coalesce(title,'') || coalesce(body,''));
 </programlisting>
 
     Then we create a <acronym>GIN</acronym> index to speed up the search:
 
 <programlisting>
-CREATE INDEX textsearch_idx ON pgweb USING gin(textsearch_index);
+CREATE INDEX textsearch_idx ON pgweb USING gin(textsearchable_index_col);
 </programlisting>
 
     Now we are ready to perform a fast full text search:
@@ -554,7 +554,7 @@ CREATE INDEX textsearch_idx ON pgweb USING gin(textsearch_index);
 <programlisting>
 SELECT title
 FROM pgweb
-WHERE to_tsquery('create &amp; table') @@ textsearch_index
+WHERE textsearchable_index_col @@ to_tsquery('create &amp; table')
 ORDER BY last_mod_date DESC LIMIT 10;
 </programlisting>
    </para>