Skip site navigation (1) Skip section navigation (2)

Re: Full Text Search examples patch

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Erik <er(at)xs4all(dot)nl>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-docs(at)postgresql(dot)org
Subject: Re: Full Text Search examples patch
Date: 2008-03-26 14:10:27
Message-ID: 200803261410.m2QEARE13898@momjian.us (view raw or flat)
Thread:
Lists: pgsql-docs
Erik wrote:
> > Hmm, wouldn't it be easier to provide the pgweb table?
> 
> Maybe - I don't know what that pgweb data would be.
> 
> There are really two issues:
> 
>   1. Apply changes I suggested (and attached earlier) to
> the documentation text to make code examples use a
> single table instead of two different ones.  I chose
> apod because I knew apod from tsearch2.  In the patch
> there are also some confusing inconsistencies removed,
> for instance column  'textsearch_indexable_col' is in a
> later code example used as column 'textsearch'.
> 
>   2. Whether or not to include some actual table data (be
> it apod or pgweb). This is less important as far as I am
> concerned.
> 
>  The first is more useful and easier to apply than the
> second.

Agreed.  The data file you sent was 1.5MB of data uncompressed.  That
isn't going in the docs.

I looked at adding just the schema you had:

	CREATE TABLE apod (
	    title text,
	    body text,
	    sdate date,
	    keywords text,
	    id integer
	);

but later saw that there were 'apod' references later in the docs that
mentioned columns that weren't in the CREATE TABLE, e.g., 'vector':

	SELECT * FROM ts_stat('SELECT vector FROM apod')
	ORDER BY nentry DESC, ndoc DESC, word
	LIMIT 10;

Please send a patch that adds the CREATE TABLE in a consistent manner
and we will consider just that addition.  Here is where I suggest you
add the CREATE TABLE in the patch:

	<programlisting>
	CREATE TABLE apod (
	    title      text,
	    body       text,
	    sdate      date,
	    keywords   text,
	    id         integer);
	
	-- insert some data
	
	SELECT title, ts_rank_cd(textsearch, query) AS rank
	FROM apod, to_tsquery('neutrino|(dark &amp; matter)') query
	WHERE query @@ textsearch
	ORDER BY rank DESC LIMIT 10;

I am fine with you updating the later examples to be more consistent
too.

-- 
  Bruce Momjian  <bruce(at)momjian(dot)us>        http://momjian.us
  EnterpriseDB                             http://postgres.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

In response to

pgsql-docs by date

Next:From: Zubkovsky, SergeyDate: 2008-03-26 14:44:16
Subject: Re: [DOCS] pg_total_relation_size() and CHECKPOINT
Previous:From: Andrew DunstanDate: 2008-03-26 13:56:18
Subject: Re: [DOCS] pg_total_relation_size() and CHECKPOINT

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group