Re: PostgreSQL idocs - Mailing list pgsql-general

From Medi Montaseri
Subject Re: PostgreSQL idocs
Date
Msg-id 3DF8DE63.2020804@intransa.com
Whole thread Raw
In response to Re: PostgreSQL idocs  (Oleg Bartunov <oleg@sai.msu.su>)
List pgsql-general
Yes I'm also in favor of grabbing one of those 'my search engine'
offerings by google and
other vendor/providers...too late to develope yet another search engine...

Oleg Bartunov wrote:

>Why not just use OpenFTS for full text searching in idocs or just tsearch ?
>It should works for such collection perfectly !
>
>    Oleg
>On Thu, 12 Dec 2002, Francois Suter wrote:
>
>
>
>>Hi all,
>>
>>I don't know who is responsible for the PostgreSQL's interactive
>>documentation so I'm writing to the general ML.
>>
>>As you probably all noticed, the idocs are pretty limited because it is not
>>possible to search several words at the same time (either with AND or OR),
>>as explained in the search help.
>>
>>Since I recently had to develop something similar (in PHP), here is the code
>>(attached file), if it can be useful and make the idocs better. It's maybe
>>not the most efficient algorithm in the world, because it's the first
>>version and I didn't yet have time to optimize it, but it does the job.
>>
>>Usage is as follows:
>>
>>- assume the search text field is called "search"
>>- assume the text field in the database is called "text"
>>
>>you can write something like that:
>>
>>$query = "SELECT * FROM table_name WHERE
>>".searchString("search","text",true,false);
>>
>>The third parameter is true for a case-insensitive search (using ILIKE). The
>>fourth parameters forces all words in the search string to be considered
>>with "AND".
>>
>>The way it works is that it takes the search string and tokenizes it around
>>blanks and + signs. Blanks are interpreted as ORs and + as ANDs. Hence for a
>>search like "word1+word2 word3", it will return the following string:
>>
>>"text" ILIKE '%word1%' AND "text" ILIKE '%word2%' OR "text" ILIKE '%word3%'
>>
>>Pretty rough, but it works. Hope this can help somehow.
>>
>>--------
>>Francois
>>
>>Home page: http://www.monpetitcoin.com/
>>"We waste our time spending money we don't have to buy things we don't need
>>to impress people we don't like"
>>
>>
>>
>>
>
>    Regards,
>        Oleg
>_____________________________________________________________
>Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
>Sternberg Astronomical Institute, Moscow University (Russia)
>Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
>phone: +007(095)939-16-83, +007(095)939-23-83
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Don't 'kill -9' the postmaster
>
>




pgsql-general by date:

Previous
From: "Johnson, Shaunn"
Date:
Subject: problems updating table
Next
From: Thomas Beutin
Date:
Subject: Re: INDEX suggestion needed