mirror of https://github.com/apache/lucene.git
SOLR-10601: StreamExpressionParser should handle white space around = in named parameters
This commit is contained in:
parent
b901d16b9b
commit
17563ce81f
|
@ -147,7 +147,7 @@ public class StreamExpressionParser {
|
||||||
int firstOpenEquals = findNextClear(clause, 0, '=');
|
int firstOpenEquals = findNextClear(clause, 0, '=');
|
||||||
if(firstOpenEquals <= 0 || firstOpenEquals == clause.length() - 1){ return false; }
|
if(firstOpenEquals <= 0 || firstOpenEquals == clause.length() - 1){ return false; }
|
||||||
String name = clause.substring(0, firstOpenEquals);
|
String name = clause.substring(0, firstOpenEquals);
|
||||||
if(!wordToken(name)){ return false; }
|
if(!wordToken(name.trim())){ return false; }
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5359,7 +5359,7 @@ public class StreamExpressionTest extends SolrCloudTestCase {
|
||||||
updateRequest.commit(cluster.getSolrClient(), COLLECTIONORALIAS);
|
updateRequest.commit(cluster.getSolrClient(), COLLECTIONORALIAS);
|
||||||
|
|
||||||
String expr = "search("+COLLECTIONORALIAS+", q=\"*:*\", fl=\"id,test_t, test_i\", sort=\"id desc\")";
|
String expr = "search("+COLLECTIONORALIAS+", q=\"*:*\", fl=\"id,test_t, test_i\", sort=\"id desc\")";
|
||||||
String cat = "let(a="+expr+", b=add(1,3), c=col(a, test_i), tuple(test=add(1,1), test1=b, results=a, test2=add(c)))";
|
String cat = "let(a ="+expr+", b = add(1,3), c=col(a, test_i), tuple(test = add(1,1), test1=b, results=a, test2=add(c)))";
|
||||||
ModifiableSolrParams paramsLoc = new ModifiableSolrParams();
|
ModifiableSolrParams paramsLoc = new ModifiableSolrParams();
|
||||||
paramsLoc.set("expr", cat);
|
paramsLoc.set("expr", cat);
|
||||||
paramsLoc.set("qt", "/stream");
|
paramsLoc.set("qt", "/stream");
|
||||||
|
|
Loading…
Reference in New Issue