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


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: ts_count
Date: 2011-06-04 12:47:02
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
One of our PostgreSQL Experts Inc customers wanted a function to count 
all the occurrences of terms in a tsquery in a tsvector. This has been 
written as a loadable module function, and initial testing shows it is 
working well. With the client's permission we are releasing the code - 
it's available at <>. The actual 
new code involved here is tiny, some of the code is C&P'd from tsrank.c 
and much of the rest is boilerplate.

A snippet from the regression test:

    select ts_count(to_tsvector('managing managers manage peons
                     to_tsquery('managers | peon'));

We'd like to add something like this for 9.2, so I'd like to get the API agreed and then I'll prepare a patch and submit it for the next CF.

Comments? cheers andrew


pgsql-hackers by date

Next:From: Simon RiggsDate: 2011-06-04 13:11:52
Subject: Re: creating CHECK constraints as NOT VALID
Previous:From: Merlin MoncureDate: 2011-06-04 12:45:50
Subject: Re: Error in PQsetvalue

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