sstults commented on code in PR #5321:
URL: https://github.com/apache/solr/pull/5321#discussion_r4551787064
##########
solr/core/src/java/org/apache/solr/search/SolrReturnFields.java:
##########
@@ -246,6 +259,27 @@ private void add(
int start = sp.pos;
+ // exclusion: -field or -glob*
+ if (sp.ch() == '-') {
+ sp.pos++;
+ String excluded = getFieldName(sp);
+ char next = sp.ch();
+ if (excluded == null || !(Character.isWhitespace(next) || next ==
',' || next == 0)) {
+ sp.pos = start + 1;
+ excluded = sp.getGlobbedId(null);
+ next = sp.ch();
+ }
Review Comment:
This parses a field name or glob after a leading -. It tries getFieldName
first because it accepts hyphens in names (-my-field), then falls back to
getGlobbedId for * and ?, which stops at -. If neither parses cleanly, it
resets so something like -1 or -sum(a,b) still goes through the function parser.
--
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]