Re: External search engine, advice - Mailing list pgsql-hackers

From mlw
Subject Re: External search engine, advice
Date
Msg-id 3B069CE0.EC994CF0@mohawksoft.com
Whole thread Raw
In response to External search engine, advice  (mlw <markw@mohawksoft.com>)
List pgsql-hackers
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.


pgsql-hackers by date:

Previous
From: mlw
Date:
Subject: Re: External search engine, advice
Next
From: Myron Scott
Date:
Subject: Re: C++ Headers