Solr
  1. Solr
  2. SOLR-244

ModifiableSolrParams -- (perhaps) modify MultiMapSolrParams

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3
    • Component/s: None
    • Labels:
      None

      Description

      The existing ways to change parameters at runtime are awkward, this is a class I have been using in SOLR-20. It is a solr params implementation with two nice additions:

      public void set( String name, String ... val )

      { ... }

      public void add( String name, String ... val )

      { ... }

      Rather then have a new class, it may be better to augment MultiMapSolrParams to include a default constructor and use set/add to modify the final Map<String,String[]>

        Activity

        Hide
        Ryan McKinley added a comment -

        This includes a new class (with tests) and augments MultiMapSolrParams with set() and add()

        Only one of the changes should be included – unless there is a good reason not to augment MultiMapSolrParams, I think that is a better solution.

        I know all of this is possible with the existing interface, but I prefer:

        MultiMapSolrParams params = new MultiMapSolrParams();
        params.add( "name", "value1" );
        ...
        params.set( "name", "value2", "value3" );

        to:

        Map<String,String[]> map = new HashMap<String, String[]>();
        MultiMapSolrParams params = new MultiMapSolrParams( map );
        MultiMapSolrParams.addParam( "name", "value1", map );
        ...
        map.put( "name", new String[]

        { "value2", "value3" }

        );

        Show
        Ryan McKinley added a comment - This includes a new class (with tests) and augments MultiMapSolrParams with set() and add() Only one of the changes should be included – unless there is a good reason not to augment MultiMapSolrParams, I think that is a better solution. I know all of this is possible with the existing interface, but I prefer: MultiMapSolrParams params = new MultiMapSolrParams(); params.add( "name", "value1" ); ... params.set( "name", "value2", "value3" ); to: Map<String,String[]> map = new HashMap<String, String[]>(); MultiMapSolrParams params = new MultiMapSolrParams( map ); MultiMapSolrParams.addParam( "name", "value1", map ); ... map.put( "name", new String[] { "value2", "value3" } );
        Hide
        Hoss Man added a comment -

        This bug was modified as part of a bulk update using the criteria...

        • Marked "Resolved" and "Fixed"
        • Had no "Fix Version" versions
        • Was listed in the CHANGES.txt for 1.3 as of today 2008-03-15

        The Fix Version for all 29 issues found was set to 1.3, email notification was suppressed to prevent excessive email.

        For a list of all the issues modified, search jira comments for this (hopefully) unique string: batch20070315hossman1

        Show
        Hoss Man added a comment - This bug was modified as part of a bulk update using the criteria... Marked "Resolved" and "Fixed" Had no "Fix Version" versions Was listed in the CHANGES.txt for 1.3 as of today 2008-03-15 The Fix Version for all 29 issues found was set to 1.3, email notification was suppressed to prevent excessive email. For a list of all the issues modified, search jira comments for this (hopefully) unique string: batch20070315hossman1

          People

          • Assignee:
            Ryan McKinley
            Reporter:
            Ryan McKinley
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development