Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-7059

Using paramset with multi-valued keys leads to a 500

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 5.0, 5.1, 6.0
    • Component/s: None
    • Labels:
      None

      Description

      Here's my use case:
      I wanted to use param-sets to have facet.field=field1&facet.field=field2
      For the same, here is what I updated:

      curl http://localhost:8983/solr/bike/config/params -H 'Content-type:application/json' -d 
      '{
        "set" : { 
          "facets" : {
            "facet.field":["start_station_name","end_station_name"]
          }
        }
      }'
      

      When I tried to use the same, I got a 500.

      After looking at the code, seems like, RequestParams uses MapSolrParams, which banks on Map<String,String> map.

      This would need to change to support the multi-values.

      I also tried sending:

      solr-5.0.0-SNAPSHOT > curl http://localhost:8983/solr/bike/config/params -H 'Content-type:application/json' -d '{"update" : { "facets" : {"facet.field":"start_station_name","facet.field":"end_station_name"}}}'
      

      This overwrote the value of facet.field with the last seen/parsed value i.e. there was only one value in the end. This is expected as that's noggit's behavior i.e. doesn't complain and just overwrites the previous value with the same key.

        Attachments

          Activity

            People

            • Assignee:
              noble.paul Noble Paul
              Reporter:
              anshum Anshum Gupta
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: