From b2bd4b51f71dd81bb5321ae484a5e6eda4a763b0 Mon Sep 17 00:00:00 2001 From: Par Winzell Date: Sun, 29 Mar 2009 19:55:24 +0000 Subject: [PATCH] Oops. We were not taking the size of the matched-against column into account at all. That's not intuitive. The more precise the match, the higher we want to rank it. --- src/java/com/samskivert/depot/impl/PostgreSQLBuilder.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/java/com/samskivert/depot/impl/PostgreSQLBuilder.java b/src/java/com/samskivert/depot/impl/PostgreSQLBuilder.java index c7cf19b..e4aad2a 100644 --- a/src/java/com/samskivert/depot/impl/PostgreSQLBuilder.java +++ b/src/java/com/samskivert/depot/impl/PostgreSQLBuilder.java @@ -67,7 +67,10 @@ public class PostgreSQLBuilder appendIdentifier("ftsCol_" + rank.getDefinition().getName()); _builder.append(", to_tsquery('"). append(translateFTConfig(getFTIndex(rank.getDefinition()).configuration())). - append("', ?), 32)"); + // TODO: The normalization parameter is really quite important, and should + // TODO: perhaps be configurable, but for the moment we hard-code it to 1: + // TODO: "divides the rank by the 1 + logarithm of the document length" + append("', ?), 1)"); } @Override public void visit (EpochSeconds epochSeconds) {