Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id F214F9FBA25 for ; Mon, 26 Feb 2007 13:55:23 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 09813-02 for ; Mon, 26 Feb 2007 13:55:10 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from svr2.hagander.net (svr2.hagander.net [88.198.128.226]) by postgresql.org (Postfix) with ESMTP id EC0509FB86A for ; Mon, 26 Feb 2007 13:55:09 -0400 (AST) Received: from [192.168.199.196] (c213-100-160-41.swipnet.se [213.100.160.41]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by svr2.hagander.net (Postfix) with ESMTP id 01381DCC5FD; Mon, 26 Feb 2007 18:55:08 +0100 (CET) Message-ID: <45E31F06.8080002@hagander.net> Date: Mon, 26 Feb 2007 18:55:18 +0100 From: Magnus Hagander User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: Madison Kelly CC: Mark Stosberg , pgsql-performance@postgresql.org Subject: Re: Writting a "search engine" for a pgsql DB References: <45E30ADA.2050700@alteeve.com> <45E31300.4070701@commandprompt.com> <45E31D28.2020402@alteeve.com> In-Reply-To: <45E31D28.2020402@alteeve.com> X-Enigmail-Version: 0.94.2.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.057 tagged_above=0 required=5 tests=AWL, BAYES_50 X-Spam-Level: X-Archive-Number: 200702/306 X-Sequence-Number: 23360 > Joshua, I've been digging around the CVS (web) looking for the search > engine code but so far have only found the reference (www.search) in > 'general.php' but can't locate the file. You wouldn't happen to have a > direct link would you? It's all in module "portal". You will find the indexing stuff in tools/search, and the search interface in system/page/search.php. > I think the more direct question I was trying to get at is "How do you > build a 'relavence' search engine? One where results are returned/sorted > by relevance of some sort?". At this point, the best I can think of, > would be to perform multiple queries; first matching the whole search > term, then the search term starting a row, then ending a row, then > anywhere in a row and "scoring" the results based on which query they > came out on. This seems terribly cumbersome (and probably slow, indexes > be damned) though. I'm hoping there is a better way! :) The tsearch2 ranking features are pretty good. //Magnus