Re: C function returning rows, was Boolean text, with phrase ranking, search under Postgres - Mailing list pgsql-general

From mlw
Subject Re: C function returning rows, was Boolean text, with phrase ranking, search under Postgres
Date
Msg-id 39EBA6BC.2905ED65@mohawksoft.com
Whole thread Raw
In response to C function returning rows, was Boolean text, with phrase ranking, search under Postgres  ("Edmar Wiggers" <edmar@brasmap.com>)
List pgsql-general
Edmar Wiggers wrote:
>
> I too am interested in full text indexing under PostgreSQL.

As I have described it, does it sound like something you would use? It
is designed more like a search engine. It will do a full text / boolean
search with phrase ranking in about 10~40 ms depending on the number of
terms, memory and CPU speed.

I need to return or, as it is implemented, fill a table with the index
keys as entries in a table to preserve rank.

BTW: it also does a modified metaphone parsing on text.

>
> Moreover, I have run into the same problem as you (in a different project
> though): how do you return more than 1 value from a C function? I'd like to
> return "rows", but, if at all possible, NOT to create a table. How about a
> cursor? Perhaps one could then do something such as
>
> insert into new_table select textsearch('bla...');

I would like this API best:

create temp table search_results as select textsearch('bla bla');

If I can do this, it will be very cool.

>
> Does anyone know if it's possible?
>
> > -----Original Message-----
> > From: markw <markw@mohawksoft.com>
> > Sent: Monday, October 16, 2000 3:33 PM
> > To: pgsql-announce@postgresql.org,pgsql-general@postgresql.org
> > Subject: [ANNOUNCE] Boolean text, with phrase ranking, search under
> > Postgres
> >
> >
> > I am working on a GPL version of a boolean text search engine for
> > PostgreSQL.
> >
> > How it works:
> >
> > You run a program which executes a query and builds a set of external
> > indexes.
> >
> > Then you run a daemon process which does the processing of the text
> > query.
> >
> > In postgres, you create a temporary table of results, call textsearch
> > which populates the table,
> > lastly, you join with the results table. The code looks like this:
> >
> > >>>>>>>>>>>>>
> > --
> > -- Create a temporary table for search results
> > --
> > create temp table search_result (key integer, rank integer);
> > --
> > -- Call search daemon to populate table
> > --
> > select textsearch('performer2{ waitresses } song { i know what boys like
> > }');
> ... (cut) ...
> > What I would like to do is create the result table in the function
> > and/or accept a table name as a parameter. I can't seem to do this,
> > perhaps I am missing something trivial.
> >
> > Is there a way to create a table from within 'c' and return it?  I am
> > not a postgres pro, I am a C/C++ guy and do not know the ins and outs of
> > Postgres, and it should be a lot easier to make something more eficient.
> > Any insign would be appreciated.

--
http://www.mohawksoft.com

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: C function returning rows, was Boolean text, with phrase ranking, search under Postgres
Next
From: Neil Conway
Date:
Subject: storing binary data