-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SOLR-13749: Change cross-collection join query syntax to {!join method=crossCollection ...} #1514
Conversation
…method=ccjoin ...}
…nJoinQParserPlugin class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still looking for the defaulting logic so that a user doesn't even need to know about "crossCollection"; it'll just work.
if (args.get("solrUrlWhitelist") != null) { | ||
//noinspection unchecked | ||
for (String s : (List<String>) args.get("solrUrlWhitelist")) { | ||
if (!StringUtils.isEmpty(s)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine, really, but personally I'd just go with 1 line of code -- solrUrlWhiteList.addAll((List<String>) args.get("solrUrlWhitelist"))
because the impact of an empty string here is safe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me - I made this change while updating the property name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing ref-guide changes?
If someone uses join QParser with either no method or the default method=index and if fromIndex refers to a non-qualifying collection (sharded or not node-local), they'll get one of the errors printed from this method:
There is another case as well when the local replica is not in an Active state but lets ignore that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great; I think that's it! I'll merge this weekend or perhaps Monday.
@danmfox Still missing Ref Guide changes to account for the refactor |
Last minute request: also please change solrUrlWhitelist to avoid this "whitelist" word (think current events) to, I propose "allowSolrUrls". There's a discussion going on now internally that probably should be public about this sort of thing. There's another patch to add a new similar thing for file system paths deliberately named "allowPaths", so that influenced my suggested new name here. |
…ection to be inline with the unit tests.
Description
Updates the cross-collection join query in #976 based on the feedback in SOLR-13749. In that ticket there was a preference to consolidate the cross-collection join functionality into the existing join query parser, rather than creating a new separate query parser.
Solution
This PR integrates the cross-collection join query parser into the existing join query parser plugin. The syntax for a cross-collection join changes from
{!xcjf ...}
to{!join method=crossCollection ...}
. The arguments that could previously be set on the XCJF query parser plugin can now be set on the join query parser plugin.Tests
The XCJFQueryTest class has been updated to use the new query syntax (and renamed to CrossCollectionJoinQueryTest).
Checklist
Please review the following and check all that apply:
master
branch.ant precommit
and the appropriate test suite.