Thread: Boolean search

Boolean search

From
Kim Kohen
Date:
Hi all,

I'm brand new to postgresql (2 weeks) and I'm trying to move a web/PHP
application from MySQL.  I've searched the PG8 docs and googled but can't
seem to find anything which is the equivalent of a MySQL boolean search
(forcing every word in a query to be present in the result row)

Does such a thing exist? I figure it's probably just called something
different but I have no idea where to look.

Cheers and thanks

Kim



Re: Boolean search

From
Michael Fuhr
Date:
On Thu, Mar 31, 2005 at 09:59:01PM +1000, Kim Kohen wrote:
>
> I'm brand new to postgresql (2 weeks) and I'm trying to move a web/PHP
> application from MySQL.  I've searched the PG8 docs and googled but can't
> seem to find anything which is the equivalent of a MySQL boolean search
> (forcing every word in a query to be present in the result row)

"Boolean search" is vague -- are you talking about what the MySQL
documentation refers to "boolean full-text search"?  If so then
see the contrib/tsearch2 module.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

Re: Boolean search

From
Kim Kohen
Date:
G'day Michael

Thanks for the reply.

> "Boolean search" is vague -- are you talking about what the MySQL
> documentation refers to "boolean full-text search"?
€€€€
Yes, that's it

> If so then see the contrib/tsearch2 module.
€€€€
I googled and read, and googled some more and I decided to have a go at
compiling from source (something I've never done before). I have the
appropriate tools installed (I'm on Mac OS X) but I'm getting an error
trying to make:

Kim-Kohens-Computer:~/Desktop/postgresql-8.0.1/contrib/tsearch2 kim$ make
Makefile:31: ../../src/Makefile.global: No such file or directory
Makefile:32: /contrib/contrib-global.mk: No such file or directory
make: *** No rule to make target `/contrib/contrib-global.mk'.  Stop.

Both of these files seem to exist (although src/Makefile.global has a .in
extension)

I was able to find a couple of old archive forum posts with the same error
but not one of them had a response. Does anyone have any idea what might be
causing this problem? If anyone is using OSX and has tsearch2 running I'd be
appreciaitive of any contact.

Cheers and thanks

Kim



Re: Boolean search

From
Michael Fuhr
Date:
On Sat, Apr 02, 2005 at 07:35:40PM +1000, Kim Kohen wrote:
>
> Kim-Kohens-Computer:~/Desktop/postgresql-8.0.1/contrib/tsearch2 kim$ make
> Makefile:31: ../../src/Makefile.global: No such file or directory
> Makefile:32: /contrib/contrib-global.mk: No such file or directory
> make: *** No rule to make target `/contrib/contrib-global.mk'.  Stop.

It looks like you haven't run configure in the top-level PostgreSQL
directory.  Do that and then try building tsearch2 again.

Some modules support the Extension Building Infrastructure (PGXS)
described in the "C-Language Functions" section of the documentation
so you can build the module without a PostgreSQL source tree.  However,
it looks like tsearch2 is only partially PGXS-ized:

% gmake USE_PGXS=1
...
gmake -C snowball SUBSYS.o
gmake[1]: Entering directory `/path/to/pgsql/contrib/tsearch2/snowball'
Makefile:5: ../../../src/Makefile.global: No such file or directory
Makefile:20: /contrib/contrib-global.mk: No such file or directory
gmake[1]: *** No rule to make target `/contrib/contrib-global.mk'.  Stop.
gmake[1]: Leaving directory `/path/to/pgsql/contrib/tsearch2/snowball'
gmake: *** [snowball-recursive] Error 2

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

Re: Boolean search

From
Jeffrey Melloy
Date:
You need to run a top-level ./configure

The easiest way to do this if you've installed PostgreSQL from a package
(like the one from http://www.entropy.de) is to run
./configure --without-readline

Which makes it compile correctly without having to install readline. If
you've installed PostgreSQL from ports or fink or something (which does
not put PostgreSQL in the default location like the package listed
above) you need to add a couple additional flags to the ./configure
telling where PostgreSQL is (/opt/local or /sw/local/, maybe)

After running a top-level configure, go into the contrib/tsearch2
directory and do the rigamarole there.

I have some instructions for installing Postgres and tsearch2 from
source on OS X at http://www.visualdistortion.org/sqllogger/install.html
... simply ignore everything after you finish setting up Postgres.

Jeff
Kim Kohen wrote:

>G'day Michael
>
>Thanks for the reply.
>
>
>
>>"Boolean search" is vague -- are you talking about what the MySQL
>>documentation refers to "boolean full-text search"?
>>
>>
>€€€€
>Yes, that's it
>
>
>
>>If so then see the contrib/tsearch2 module.
>>
>>
>€€€€
>I googled and read, and googled some more and I decided to have a go at
>compiling from source (something I've never done before). I have the
>appropriate tools installed (I'm on Mac OS X) but I'm getting an error
>trying to make:
>
>Kim-Kohens-Computer:~/Desktop/postgresql-8.0.1/contrib/tsearch2 kim$ make
>Makefile:31: ../../src/Makefile.global: No such file or directory
>Makefile:32: /contrib/contrib-global.mk: No such file or directory
>make: *** No rule to make target `/contrib/contrib-global.mk'.  Stop.
>
>Both of these files seem to exist (although src/Makefile.global has a .in
>extension)
>
>I was able to find a couple of old archive forum posts with the same error
>but not one of them had a response. Does anyone have any idea what might be
>causing this problem? If anyone is using OSX and has tsearch2 running I'd be
>appreciaitive of any contact.
>
>Cheers and thanks
>
>Kim
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>
>