Re: [HACKERS] ts_count

2011-11-03 Thread Andrew Dunstan
On 06/04/2011 04:51 PM, Oleg Bartunov wrote: Well, there are several functions available around tsearch2. so I suggest somebody to collect all of them and create one extension - ts_addon. For example, these are what I remember: 1. tsvector2array 2. noccurences(tsvector, tsquery) - like your ts_

Re: [HACKERS] ts_count

2011-06-04 Thread Andrew Dunstan
On 06/04/2011 08:59 PM, Alvaro Herrera wrote: Excerpts from Andrew Dunstan's message of sáb jun 04 08:47:02 -0400 2011: A snippet from the regression test: select ts_count(to_tsvector('managing managers manage peons managerially'), to_tsquery('managers | peon'));

Re: [HACKERS] ts_count

2011-06-04 Thread Alvaro Herrera
Excerpts from Andrew Dunstan's message of sáb jun 04 08:47:02 -0400 2011: > A snippet from the regression test: > > > select ts_count(to_tsvector('managing managers manage peons > managerially'), > to_tsquery('managers | peon')); > ts_count > -- >

Re: [HACKERS] ts_count

2011-06-04 Thread Andrew Dunstan
On 06/04/2011 04:51 PM, Oleg Bartunov wrote: Well, there are several functions available around tsearch2. so I suggest somebody to collect all of them and create one extension - ts_addon. For example, these are what I remember: 1. tsvector2array 2. noccurences(tsvector, tsquery) - like your ts_

Re: [HACKERS] ts_count

2011-06-04 Thread Oleg Bartunov
Well, there are several functions available around tsearch2. so I suggest somebody to collect all of them and create one extension - ts_addon. For example, these are what I remember: 1. tsvector2array 2. noccurences(tsvector, tsquery) - like your ts_count 3. nmatches(tsvector, tsquery) - # of matc

[HACKERS] ts_count

2011-06-04 Thread Andrew Dunstan
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 avai