SOLR-9118: HashQParserPlugin should trim partition keys

This commit is contained in:
jbernste 2016-05-17 14:10:34 -04:00
parent 01ed4a5f7d
commit 93201cd07e
2 changed files with 3 additions and 2 deletions

View File

@ -69,6 +69,7 @@ public class HashQParserPlugin extends QParserPlugin {
int workers = localParams.getInt("workers");
int worker = localParams.getInt("worker");
String keys = params.get("partitionKeys");
keys = keys.replace(" ", "");
return new HashQuery(keys, workers, worker);
}
}

View File

@ -199,7 +199,7 @@ public class TestHashQParserPlugin extends SolrTestCaseJ4 {
params = new ModifiableSolrParams();
params.add("q", "*:*");
params.add("fq", "{!hash worker=0 workers=2 cost="+getCost(random)+"}");
params.add("partitionKeys", "a_s,a_i,a_l");
params.add("partitionKeys", "a_s, a_i, a_l");
params.add("rows","50");
set1 = new HashSet();
response = h.query(req(params));
@ -217,7 +217,7 @@ public class TestHashQParserPlugin extends SolrTestCaseJ4 {
params = new ModifiableSolrParams();
params.add("q", "*:*");
params.add("fq", "{!hash worker=1 workers=2 cost="+getCost(random)+"}");
params.add("partitionKeys", "a_s,a_i,a_l");
params.add("partitionKeys", "a_s, a_i, a_l");
params.add("rows","50");
set2 = new HashSet();
response = h.query(req(params));