Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id D24921337B3E for ; Tue, 2 Nov 2010 14:59:20 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 64082-02 for ; Tue, 2 Nov 2010 17:59:13 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 6464A1337B2F for ; Tue, 2 Nov 2010 14:59:13 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Tue, 02 Nov 2010 12:59:06 -0500 Message-Id: <4CD00B10020000250003719D@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Tue, 02 Nov 2010 12:58:56 -0500 From: "Kevin Grittner" To: "Katharina kuhn" , Subject: Re: CREATE CUSTOM TEXT SEARCH PARSER References: In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.21 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/1 X-Sequence-Number: 6199 Katharina kuhn wrote: > I'd like to build a custom text search parser and then use it > within a custom text search configuration. > It would be great if you could give us an example showing how to > build a custom parser, including examples of start, gettoken and > end functions. You might want to look at the contrib/test_parser directory. Then again, you might not -- I needed some custom tsearch2 parsing behavior and struggled with a custom parser based on that for a couple days before I decided that it was easier to use regular expression functions within pl/pgsql to pick out what I wanted and cast it to a tsvector. This was less code and seemed less fragile than the developing soemthing based on the contrib example. YMMV, of course. This motivated me to put a rewrite of the current tsearch2 parser to something based on regular expressions onto my personal PostgreSQL TODO list. (No guarantees on when I might get to it, though.) -Kevin