Skip to content
Permalink
Browse files

Override qf and df Solr params with defaults only when they are not set

  • Loading branch information...
luccioman committed Jul 23, 2018
1 parent 88e6ce2 commit 313204ae2c8cdd52961a61efb2315d2b2bdbbde0
Showing with 3 additions and 3 deletions.
  1. +3 −3 source/net/yacy/http/servlets/SolrSelectServlet.java
@@ -245,13 +245,13 @@ public void run() {
// add default queryfield parameter according to local ranking config (or defaultfield)
if (ranking != null) { // ranking normally never null
final String qf = ranking.getQueryFields();
if (qf.length() > 4) { // make sure qf has content (else use df)
if (qf.length() > 4 && !mmsp.getMap().containsKey(DisMaxParams.QF)) { // make sure qf has content (else use df)
MultiMapSolrParams.addParam(DisMaxParams.QF, qf, mmsp.getMap()); // add QF that we set to be best suited for our index
// TODO: if every peer applies a decent QF itself, this can be reverted to getMap().put()
} else {
} else if(!mmsp.getMap().containsKey(CommonParams.DF)) {
mmsp.getMap().put(CommonParams.DF, new String[]{CollectionSchema.text_t.getSolrFieldName()});
}
} else {
} else if(!mmsp.getMap().containsKey(CommonParams.DF)) {
mmsp.getMap().put(CommonParams.DF, new String[]{CollectionSchema.text_t.getSolrFieldName()});
}

0 comments on commit 313204a

Please sign in to comment.
You can’t perform that action at this time.