Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 8A1EC2E2DB2 for ; Fri, 7 Mar 2008 01:40:20 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 41267-03 for ; Fri, 7 Mar 2008 01:40:13 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id A02D32E2D49 for ; Fri, 7 Mar 2008 01:40:14 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m275eDRK006690; Fri, 7 Mar 2008 00:40:13 -0500 (EST) To: "b wragg" cc: pgsql-performance@postgresql.org Subject: Re: Improve Full text rank in a query In-reply-to: <000b01c88007$8c07b1a0$0502a8c0@windoze> References: <000b01c88007$8c07b1a0$0502a8c0@windoze> Comments: In-reply-to "b wragg" message dated "Fri, 07 Mar 2008 14:58:47 +1100" Date: Fri, 07 Mar 2008 00:40:13 -0500 Message-ID: <6689.1204868413@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/146 X-Sequence-Number: 29100 "b wragg" writes: > I'm new to this, but I can't figure out why the "Gunbower Island Primary > School" is getting top place. How do I get the query to improve the ranking > so that an exact match (like "Gunbower|Island|Vic") gets a higher position? I'm new at this too, but AFAICS these are both exact matches: they have the same matching lexemes at the same positions, so the basic rank calculation is going to come out exactly the same. Normalization option 32 doesn't help (as the manual notes, it's purely cosmetic). So it's random chance which one comes out first. What I think you might want is one of the other normalization options, so that shorter documents are preferred. Either 1, 2, 8, or 16 would do fine for this simple example --- which one you want depends on just how heavily you want to favor shorter documents. regards, tom lane