Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id D0FE79FB9FC for ; Mon, 26 Feb 2007 13:32:48 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 72992-03 for ; Mon, 26 Feb 2007 13:32:41 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id BFEA09FB9F8 for ; Mon, 26 Feb 2007 13:32:41 -0400 (AST) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 0A544308F7; Mon, 26 Feb 2007 18:32:40 +0100 (MET) From: Mark Stosberg X-Newsgroups: pgsql.performance Subject: Re: Writting a "search engine" for a pgsql DB Date: Mon, 26 Feb 2007 12:32:09 -0500 Organization: Hub.Org Networking Services Lines: 43 Message-ID: References: <45E30ADA.2050700@alteeve.com> <45E31300.4070701@commandprompt.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org User-Agent: Thunderbird 1.5.0.8 (X11/20061109) In-Reply-To: <45E31300.4070701@commandprompt.com> To: pgsql-performance@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.248 tagged_above=0 required=5 tests=AWL, BAYES_50 X-Spam-Level: X-Archive-Number: 200702/302 X-Sequence-Number: 23356 Joshua D. Drake wrote: > Madison Kelly wrote: >> Hi all, >> >> I am asking in this list because, at the end of the day, this is a >> performance question. >> >> I am looking at writing a search engine of sorts for my database. I >> have only ever written very simple search engines before which amounted >> to not much more that the query string being used with ILIKE on a pile >> of columns. This was pretty rudimentary and didn't offer anything like >> relevance sorting and such (I'd sort by result name, age or whatnot). >> >> So I am hoping some of you guys and gals might be able to point me >> towards some resources or offer some tips or gotcha's before I get >> started on this. I'd really like to come up with a more intelligent >> search engine that doesn't take two minutes to return results. :) I >> know, in the end good indexes and underlying hardware will be important, >> but a sane as possible query structure helps to start with. > > See search.postgresql.org, you can download all source from > gborg.postgresql.org. Joshua, What's the name of the project referred to? There's nothing named "search" hosted on Gborg according to this project list: http://gborg.postgresql.org/project/projdisplaylist.php Madison, For small data sets and simpler searches, the approach you have been using can be appropriate. You may just want to use a small tool in a regular programming language to help build the query. I wrote such a tool for Perl: http://search.cpan.org/~markstos/SQL-KeywordSearch-1.11/lib/SQL/KeywordSearch.pm For large or complex searches, a more specialized search system may be appropriate. I suspect that's kind of tool that Joshua is referencing. Mark