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-11617 #310
SOLR-11617 #310
Conversation
Nice docs. Lets not provide an option to configure whitespace/trim handling -- configuration-itis. IMO we should be consistent with other parts of Solr on what to do (e.g. props on core creation) but you seem to feel strongly about it so whatever. It's not that I don't disagree with your point of view, it's only that I think consistency is a higher virtue. Can you add a test please? It could be a simple modification to an existing test. |
public static class ModifyAlias extends AsyncCollectionAdminRequest { | ||
|
||
private final String aliasName; | ||
private static Map<String,String> metadata = new HashMap<>(); |
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.
Obviously "static" is a mistake here; I'll fix it.
public SolrParams getParams() { | ||
ModifiableSolrParams params = (ModifiableSolrParams) super.getParams(); | ||
params.set(CoreAdminParams.NAME, aliasName); | ||
metadata.keySet().forEach(key -> params.set("metadata." + key, metadata.get(key))); |
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.
Better:
metadata.forEach((key, value) -> params.set("metadata." + key, value));
I'll do it.
https://issues.apache.org/jira/browse/SOLR-11617 was released in Solr 7.3, so this PR can be closed. |
Changes as mentioned in Jira comment, plus rather than decide I provided an option for the user to enable whitespace values. By default this is off and whitespace values are treated as null, but if the user really wants to set a value to 3 spaces they can by passing allowWhitespaceValues=true. I'm fairly set against pure whitespace keys unless someone can supply up with a good reason for that.