Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 6DB4D2E004A for ; Wed, 26 Mar 2008 11:11:02 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 34703-02 for ; Wed, 26 Mar 2008 11:10:40 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from momjian.us (momjian.us [70.90.9.53]) by postgresql.org (Postfix) with ESMTP id E516D2E005A for ; Wed, 26 Mar 2008 11:10:40 -0300 (ADT) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id m2QEARE13898; Wed, 26 Mar 2008 10:10:27 -0400 (EDT) From: Bruce Momjian Message-Id: <200803261410.m2QEARE13898@momjian.us> Subject: Re: Full Text Search examples patch In-Reply-To: <8935.156.83.0.77.1200449197.squirrel@webmail.xs4all.nl> To: Erik Date: Wed, 26 Mar 2008 10:10:27 -0400 (EDT) CC: Alvaro Herrera , Tom Lane , pgsql-docs@postgresql.org X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/48 X-Sequence-Number: 4860 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: 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 & 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 http://momjian.us EnterpriseDB http://postgres.enterprisedb.com + If your life is a hard drive, Christ can be your backup. +