dsmiley commented on code in PR #4512:
URL: https://github.com/apache/solr/pull/4512#discussion_r3500187537


##########
solr/core/src/java/org/apache/solr/schema/NestPathField.java:
##########
@@ -76,6 +76,15 @@ public Query getFieldQuery(QParser parser, SchemaField 
field, String externalVal
           "Field " + field.getName() + " cannot be queried with a null.");
     }
 
+    if (externalVal.contains("\\")) {
+      throw new SolrException(
+          SolrException.ErrorCode.BAD_REQUEST,
+          "Field "
+              + field.getName()
+              + " query value contains backslashes ('\\'). "
+              + "For root document queries, pass the raw single slash '/' 
without escaping.");

Review Comment:
   This line (the last sentence) here doesn't seem useful to me; IMO it's 
somewhat a distraction.  This check is not coupled to querying for the root 
document; it's applicable for *any* field value since *any* field value will 
need a forward slash (and no backward slashes).  I think the beginning part of 
the exception message is fine.  Someone seeing it will have enough information 
to know there's a critical problem and roughly what the issue is.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to