search interfaces if no other ranking attributes are given
- using the YaCy ranking in the GSA interface only if there was not
given a GSA-style sort attribute
- to avoid confusion about correct ranking attributes, only the default
'0'-ranking profile is used and not scenario-adopted (site, date)
because that should be configurable in the web interface before it is
used actually for ranking.
if(bq.length()>0)post.put("bq",bq);// a boost query that moves double content to the back
if(bf.length()>0)post.put(ranking.getMethod()==Ranking.BoostFunctionMode.add?"bf":"boost",bf);// a boost function extension, see http://wiki.apache.org/solr/ExtendedDisMax#bf_.28Boost_Function.2C_additive.29
// set ranking
if(post.containsKey("sort")){
// if a gsa-style sort attribute is given, use this to set the solr sort attribute
if(bq.length()>0)post.put("bq",bq);// a boost query that moves double content to the back
if(bf.length()>0)post.put(ranking.getMethod()==Ranking.BoostFunctionMode.add?"bf":"boost",bf);// a boost function extension, see http://wiki.apache.org/solr/ExtendedDisMax#bf_.28Boost_Function.2C_additive.29
if(!post.containsKey("bq")&&bq.length()>0)post.put("bq",bq);// a boost query that moves double content to the back
if(!(post.containsKey("bf")||post.containsKey("boost"))&&bf.length()>0)post.put(ranking.getMethod()==Ranking.BoostFunctionMode.add?"bf":"boost",bf);// a boost function extension, see http://wiki.apache.org/solr/ExtendedDisMax#bf_.28Boost_Function.2C_additive.29
}
// get a response writer for the result
Stringwt=post.get(CommonParams.WT,"xml");// maybe use /solr/select?q=*:*&start=0&rows=10&wt=exml
Rankingranking=indexSegment.fulltext().getDefaultConfiguration().getRanking(this.ranking.coeff_date==RankingProfile.COEFF_MAX?1:(this.modifier.sitehash!=null||this.modifier.sitehost!=null)?2:0);// for a by-date ranking select different ranking profile