Re: C function returning rows, was Boolean text, with phrase ranking, search under Postgres

From: mlw <markw(at)mohawksoft(dot)com>
To: Edmar Wiggers <edmar(at)brasmap(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: C function returning rows, was Boolean text, with phrase ranking, search under Postgres
Date: 2000-10-17 01:09:16
Message-ID: 39EBA6BC.2905ED65@mohawksoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-announce 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(at)mohawksoft(dot)com>
> > Sent: Monday, October 16, 2000 3:33 PM
> > To: pgsql-announce(at)postgresql(dot)org,pgsql-general(at)postgresql(dot)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

In response to

Responses

Browse pgsql-announce by date

  From Date Subject
Next Message Yutaka tanida 2000-10-17 03:34:34 Re: New PostgreSQL binary distro for Windows NT
Previous Message Tom Lane 2000-10-17 00:51:58 Re: C function returning rows, was Boolean text, with phrase ranking, search under Postgres

Browse pgsql-general by date

  From Date Subject
Next Message Rick Roberts 2000-10-17 02:22:46 Compiling JDBC Driver
Previous Message Tom Lane 2000-10-17 00:51:58 Re: C function returning rows, was Boolean text, with phrase ranking, search under Postgres