use solr boost configuration to select search fields. At this time it is

possible to enter a negative boost value to switch that value off. This
might be different in the future with a better input interface.
pull/1/head
Michael Peter Christen 12 years ago
parent a6ad1d6fd1
commit 98819ec3d9

@ -944,7 +944,7 @@ WikiAccess = admin
# this is currently only a single default profile
# If this profile setting is empty, a hard-coded profile from plasmaSearchRanking is used
search.ranking.rwi.profile =
search.ranking.solr.boost.tmp=
search.ranking.solr.boost.tmp2=
search.ranking.solr.doubledetection.minlength=3
search.ranking.solr.doubledetection.quantrate=0.5f

@ -35,20 +35,6 @@ public class Boost extends LinkedHashMap<YaCySchema, Float> {
private static final long serialVersionUID = 5248172257724571603L;
public final static Boost RANKING = new Boost();
public final static YaCySchema[] GOAL_FIELDS = new YaCySchema[]{
YaCySchema.sku,
YaCySchema.url_paths_sxt,
YaCySchema.title,
YaCySchema.h1_txt,
YaCySchema.h2_txt,
YaCySchema.author,
YaCySchema.description,
YaCySchema.keywords,
YaCySchema.text_t,
YaCySchema.synonyms_sxt,
YaCySchema.references_i
};
// for minTokenLen = 2 the quantRate value should not be below 0.24; for minTokenLen = 3 the quantRate value must be not below 0.5!
private float quantRate = 0.5f; // to be filled with search.ranking.solr.doubledetection.quantrate
@ -60,6 +46,7 @@ public class Boost extends LinkedHashMap<YaCySchema, Float> {
}
public void initDefaults() {
this.clear();
put(YaCySchema.sku, 20.0f);
put(YaCySchema.url_paths_sxt, 20.0f);
put(YaCySchema.title, 15.0f);
@ -70,9 +57,7 @@ public class Boost extends LinkedHashMap<YaCySchema, Float> {
put(YaCySchema.keywords, 2.0f);
put(YaCySchema.text_t, 1.0f);
put(YaCySchema.synonyms_sxt, 0.9f);
// boosts on non-goal fields which are used for a special ranking order
put(YaCySchema.fuzzy_signature_unique_b, 100000.0f); // must be very high to move double results to end of list
put(YaCySchema.references_i, 0.5f);
}
/**
@ -124,7 +109,7 @@ public class Boost extends LinkedHashMap<YaCySchema, Float> {
* @return
*/
public String getBoostQuery() {
return YaCySchema.fuzzy_signature_unique_b.getSolrFieldName() + ":true^" + Float.toString(this.get(YaCySchema.fuzzy_signature_unique_b));
return YaCySchema.fuzzy_signature_unique_b.getSolrFieldName() + ":true^100000.0f";
}
/**

@ -463,7 +463,7 @@ public final class SwitchboardConstants {
* ranking
*/
public static final String SEARCH_RANKING_RWI_PROFILE = "search.ranking.rwi.profile"; // old rwi rankingProfile ranking
public static final String SEARCH_RANKING_SOLR_BOOST = "search.ranking.solr.boost.tmp"; // temporary until we know best default values
public static final String SEARCH_RANKING_SOLR_BOOST = "search.ranking.solr.boost.tmp2"; // temporary until we know best default values
public static final String SEARCH_RANKING_SOLR_DOUBLEDETECTION_MINLENGTH = "search.ranking.solr.doubledetection.minlength";
public static final String SEARCH_RANKING_SOLR_DOUBLEDETECTION_QUANTRATE = "search.ranking.solr.doubledetection.quantrate";

Loading…
Cancel
Save