mirror of https://github.com/apache/lucene.git
SOLR-4333: edismax to not double-escape colons if already escaped by client application
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1470577 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
60ffa638b6
commit
a24f93e728
|
@ -64,6 +64,9 @@ Bug Fixes
|
|||
|
||||
* SOLR-4741: Deleting a collection should set DELETE_DATA_DIR to true.
|
||||
(Mark Miller)
|
||||
|
||||
* SOLR-4333: edismax parser to not double-escape colons if already escaped by
|
||||
the client application (James Dyer, Robert J. van der Boon)
|
||||
|
||||
Other Changes
|
||||
----------------------
|
||||
|
|
|
@ -812,7 +812,7 @@ public class ExtendedDismaxQParser extends QParser {
|
|||
clause.raw = s.substring(start, pos);
|
||||
// escape colons, except for "match all" query
|
||||
if(!"*:*".equals(clause.raw)) {
|
||||
clause.raw = clause.raw.replaceAll(":", "\\\\:");
|
||||
clause.raw = clause.raw.replaceAll("([^\\\\]):", "$1\\\\:");
|
||||
}
|
||||
} else {
|
||||
clause.raw = s.substring(start, pos);
|
||||
|
|
|
@ -847,6 +847,15 @@ public class TestExtendedDismaxParser extends SolrTestCaseJ4 {
|
|||
"defType", "edismax")
|
||||
, "*[count(//doc)=1]");
|
||||
|
||||
assertQ(
|
||||
"Might be double-escaping a client-escaped colon",
|
||||
req("q", "text_sw:(theos OR thistokenhasa\\:preescapedcolon OR theou)", "defType", "edismax", "qf", "id"),
|
||||
"*[count(//doc)=3]");
|
||||
assertQ(
|
||||
"Might be double-escaping a client-escaped colon",
|
||||
req("q", "text_sw:(theos OR thistokenhasa\\:preescapedcolon OR theou)", "defType", "edismax", "qf", "text"),
|
||||
"*[count(//doc)=3]");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue