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

New Admin gui fails to parse local params in the "Raw Query Parameters" query field

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 6.0.1
    • None
    • Admin UI
    • None

    Description

      Including any local params in the "Raw Query Parameters" query field, such as for a rerank query

      rq={!rerank reRankQuery=$rqq reRankDocs=1000 reRankWeight=3}&rqq=(hi+hello+hey+hiya)

      results in an error:

      org.apache.solr.common.SolrException: org.apache.solr.search.SyntaxError: Expected identifier at pos 20 str='{!rerank reRankQuery'
      	at org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:219)
      

      It's clear that the resulting URL is malformed:

      http://localhost:8983/solr/collection1/select?fl=name,%20score&indent=on&q=greetings&rq={!rerank%20reRankQuery&rqq=(hi+hello+hey+hiya)&wt=json
      

      This appears to be due to javascript code naively splitting on '='.

      /solr/webapp/web/js/angular/controllers/query.js

      if ($scope.rawParams) {
        var rawParams = $scope.rawParams.split(/[&\n]/);
        for (var i in rawParams) {
          var param = rawParams[i];
          var parts = param.split("=");
        }
      }
      

      I've attached a possible patch.

      Attachments

        1. SOLR-9263.patch
          0.7 kB
          Brian Sawyer

        Issue Links

          Activity

            People

              arafalov Alexandre Rafalovitch
              bsawyer Brian Sawyer
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: