You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by fsparv <gi...@git.apache.org> on 2018/01/24 04:04:10 UTC

[GitHub] lucene-solr pull request #310: SOLR-11617

GitHub user fsparv opened a pull request:

    https://github.com/apache/lucene-solr/pull/310

    SOLR-11617

    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.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/nsoft/lucene-solr SOLR-11617

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/lucene-solr/pull/310.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #310
    
----
commit 959401b9ac6bac5e4d696a750c3e5eb42b7da9f5
Author: gus <gu...@...>
Date:   2018-01-23T19:28:11Z

    SOLR 11617 - patch 2

commit 218890d7b8c01bddabd1de2a6bbe2f1735ac238c
Author: Gus Heck <gu...@...>
Date:   2018-01-23T20:43:54Z

    Merge branch 'master' into SOLR-11617

commit 4b4c656a107eba82ec1bfe11e8f5b14b1ea751bf
Author: Gus Heck <gu...@...>
Date:   2018-01-24T03:44:46Z

    adjust for package changes in master

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[GitHub] lucene-solr pull request #310: SOLR-11617

Posted by dsmiley <gi...@git.apache.org>.
Github user dsmiley commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/310#discussion_r164310023
  
    --- Diff: solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java ---
    @@ -1319,6 +1320,40 @@ protected CollectionAdminResponse createResponse(SolrClient client) {
     
       }
     
    +  // MODIFYALIAS request
    +
    +  /**
    +   * Returns a SolrRequest to add or remove metadata from a request
    +   * @param aliasName         the alias to modify
    +   */
    +
    +  public static ModifyAlias modifyAlias(String aliasName) {
    +    return new ModifyAlias(aliasName);
    +  }
    +
    +  public static class ModifyAlias extends AsyncCollectionAdminRequest {
    +
    +    private final String aliasName;
    +    private static Map<String,String> metadata = new HashMap<>();
    --- End diff --
    
    Obviously "static" is a mistake here; I'll fix it.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[GitHub] lucene-solr pull request #310: SOLR-11617

Posted by dsmiley <gi...@git.apache.org>.
Github user dsmiley commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/310#discussion_r164310118
  
    --- Diff: solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java ---
    @@ -1319,6 +1320,40 @@ protected CollectionAdminResponse createResponse(SolrClient client) {
     
       }
     
    +  // MODIFYALIAS request
    +
    +  /**
    +   * Returns a SolrRequest to add or remove metadata from a request
    +   * @param aliasName         the alias to modify
    +   */
    +
    +  public static ModifyAlias modifyAlias(String aliasName) {
    +    return new ModifyAlias(aliasName);
    +  }
    +
    +  public static class ModifyAlias extends AsyncCollectionAdminRequest {
    +
    +    private final String aliasName;
    +    private static Map<String,String> metadata = new HashMap<>();
    +
    +    public ModifyAlias(String aliasName) {
    +      super(CollectionAction.MODIFYALIAS);
    +      this.aliasName = SolrIdentifierValidator.validateAliasName(aliasName);
    +    }
    +
    +    public void addMetadata(String key, String value) {
    +      metadata.put(key,value);
    +    }
    +
    +    @Override
    +    public SolrParams getParams() {
    +      ModifiableSolrParams params = (ModifiableSolrParams) super.getParams();
    +      params.set(CoreAdminParams.NAME, aliasName);
    +      metadata.keySet().forEach(key -> params.set("metadata." + key, metadata.get(key)));
    --- End diff --
    
    Better:
    ```
    metadata.forEach((key, value) ->  params.set("metadata." + key, value));
    ```
    I'll do it.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[GitHub] lucene-solr issue #310: SOLR-11617

Posted by dsmiley <gi...@git.apache.org>.
Github user dsmiley commented on the issue:

    https://github.com/apache/lucene-solr/pull/310
  
    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.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org