pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: Katharina kuhn <katykuhn@gmail.com>
To: pgsql-docs@postgresql.org
Subject: Re: CREATE CUSTOM TEXT SEARCH PARSER
Date: Tue, 02 Nov 2010 12:58:56 -0500
Message-ID: <4CD00B10020000250003719D@gw.wicourts.gov> (raw)
In-Reply-To: <AANLkTi=9zAuHaG6h=FoiAgSAV3_ye=912qw8rOu-0oFs@mail.gmail.com>
References: <AANLkTi=9zAuHaG6h=FoiAgSAV3_ye=912qw8rOu-0oFs@mail.gmail.com>

Katharina kuhn <katykuhn@gmail.com> 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



view thread (3+ messages)  latest in thread

Message-ID: <4CD00B10020000250003719D@gw.wicourts.gov>
Permalink:  ../4CD00B10020000250003719D@gw.wicourts.gov/
Also on:    postgresql.org/message-id/4CD00B10020000250003719D@gw.wicourts.gov

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: Kevin.Grittner@wicourts.gov, katykuhn@gmail.com
  Subject: Re: CREATE CUSTOM TEXT SEARCH PARSER
  In-Reply-To: <4CD00B10020000250003719D@gw.wicourts.gov>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox