From 416481c33e77fdcc3d6770e728ff67df56934855 Mon Sep 17 00:00:00 2001 From: orbiter Date: Thu, 30 Jan 2014 10:51:08 +0100 Subject: [PATCH] added a boost on appearance of combined words (in the same order the user submitted that) when searching for more than one word --- source/net/yacy/search/query/QueryParams.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/net/yacy/search/query/QueryParams.java b/source/net/yacy/search/query/QueryParams.java index 1d1830c85..67b2af3b5 100644 --- a/source/net/yacy/search/query/QueryParams.java +++ b/source/net/yacy/search/query/QueryParams.java @@ -349,6 +349,11 @@ public final class QueryParams { String bq = ranking.getBoostQuery(); String bf = ranking.getBoostFunction(); + if (this.queryGoal.getIncludeSize() > 1) { + // add boost on combined words + if (bq.length() > 0) bq += " "; + bq += CollectionSchema.text_t.getSolrFieldName() + ":\"" + this.queryGoal.getIncludeString() + "\"^10"; + } if (bq.length() > 0) params.setParam("bq", bq); if (bf.length() > 0) params.setParam("boost", bf); // a boost function extension, see http://wiki.apache.org/solr/ExtendedDisMax#bf_.28Boost_Function.2C_additive.29