Tatsuo Ishii wrote:
>
> > Well, I kind of have that already. I can return a set, but I can't use it in a
> > join.
> >
> > freedb=# select ftss_search('all { pink floyd money }') ;
> > ftss_search
> > -------------
> > 120
> > (1 row)
> >
> > freedb=# select * from cdsongs where songid = ftss_results() ;
> > ERROR: Set-valued function called in context that cannot accept a set
> >
> > How do you join against a set?
>
> Well, assuming that ftss_results() returns a set of songid, you could
> do something like:
>
> select * from cdsongs where songid in (select ftss_results());
That, however, does not use the songid index, thus it renders the text search
engine useless.
>
> BTW, what's the difference between ftss_search and ftss_results?
ftss_search executes the search to the external engine, and returns the number
of results. ftss_results returns the set of results.