mirror of https://github.com/apache/lucene.git
SOLR-2110: make sure to quote keys that start with $
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@995557 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8f8132bdfc
commit
c6acdba4a2
|
@ -216,10 +216,12 @@ public class QueryParsing {
|
|||
|
||||
public static String encodeLocalParamVal(String val) {
|
||||
int len = val.length();
|
||||
int i;
|
||||
for (i=0; i<len; i++) {
|
||||
char ch = val.charAt(i);
|
||||
if (Character.isWhitespace(ch) || ch=='}') break;
|
||||
int i = 0;
|
||||
if (len > 0 && val.charAt(0) != '$') {
|
||||
for (;i<len; i++) {
|
||||
char ch = val.charAt(i);
|
||||
if (Character.isWhitespace(ch) || ch=='}') break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i>=len) return val;
|
||||
|
|
|
@ -177,7 +177,8 @@ public class TestDistributedSearch extends BaseDistributedSearchTestCase {
|
|||
handle.put("facet_fields", SKIPVAL);
|
||||
query("q","*:*", "rows",0, "facet","true", "facet.field",t1,"facet.limit",5, "facet.shard.limit",5);
|
||||
// check a complex key name
|
||||
query("q","*:*", "rows",0, "facet","true", "facet.field","{!key='a b/c \\' \\} foo'}"+t1,"facet.limit",5, "facet.shard.limit",5);
|
||||
query("q","*:*", "rows",0, "facet","true", "facet.field","{!key='$a b/c \\' \\} foo'}"+t1,"facet.limit",5, "facet.shard.limit",5);
|
||||
query("q","*:*", "rows",0, "facet","true", "facet.field","{!key='$a'}"+t1,"facet.limit",5, "facet.shard.limit",5);
|
||||
handle.remove("facet_fields");
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue