abumarjikar commented on code in PR #4512:
URL: https://github.com/apache/solr/pull/4512#discussion_r3385869958
##########
solr/core/src/java/org/apache/solr/schema/NestPathField.java:
##########
@@ -62,4 +67,16 @@ public void setArgs(IndexSchema schema, Map<String, String>
args) {
setIndexAnalyzer(new TokenizerChain(customAnalyzer));
// leave queryAnalyzer as literal
}
+
+ @Override
+ public Query getFieldQuery(QParser parser, SchemaField field, String
externalVal) {
+ if (externalVal == null || externalVal.isEmpty() ||
"/".equals(externalVal)) {
Review Comment:
@dsmiley My initial thought with including null and empty string checks was
to cover the different ways a user might try to target the root level via
LocalParams v. I was thinking about these three variations:
q={!field f=_nest_path_ v="/"} (Explicit forward-slash shortcut)
q={!field f=_nest_path_ v=""} (Empty string)
q={!field f=_nest_path_} (Omitting v entirely, evaluating to null)
I actually added the empty string check because I recalled your comment on
Jira mentioning that "An empty string should be equivalent as well." >
That said, your point here about null or omitted values potentially masking
client-side bugs or malformed application variables is very fair. If you feel
it's safer to narrow this down strictly to "/"" and """—and throw a
SolrException(ErrorCode.BAD_REQUEST, ...) for an omitted/null value—let me
know! I'm happy to adjust the code
--
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]