You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ja...@apache.org on 2016/03/30 12:56:47 UTC

lucene-solr:branch_5x: SOLR-8870: AngularJS support for qt style handlers, and fix slash encoding bug to support Query panel through proxy (cherry picked from commit aec11eb)

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_5x db1f11d48 -> 6ca664dbd


SOLR-8870: AngularJS support for qt style handlers, and fix slash encoding bug to support Query panel through proxy
(cherry picked from commit aec11eb)


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/6ca664db
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/6ca664db
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/6ca664db

Branch: refs/heads/branch_5x
Commit: 6ca664dbd77af9feccfb76ad4a900115e7336291
Parents: db1f11d
Author: Jan Høydahl <ja...@apache.org>
Authored: Tue Mar 29 00:31:40 2016 +0200
Committer: Jan Høydahl <ja...@apache.org>
Committed: Wed Mar 30 12:56:04 2016 +0200

----------------------------------------------------------------------
 solr/CHANGES.txt                                | 3 +++
 solr/webapp/web/js/angular/controllers/query.js | 9 +++++++--
 solr/webapp/web/js/angular/services.js          | 4 ++--
 3 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6ca664db/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index f29cd66..192a21c 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -40,6 +40,9 @@ Bug Fixes
   hasn't refreshed yet). In this case the reported size of the file is -1.
   (Shai Erera, Alexey Serba, Richard Coggins)
 
+* SOLR-8870: AngularJS Query tab no longer URL-encodes the /select part of the request, fixing possible 404 issue
+  when Solr is behind a proxy. Also, now supports old-style &qt param when handler not prefixed with "/" (janhoy)
+
 ======================= 5.5.0 =======================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6ca664db/solr/webapp/web/js/angular/controllers/query.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/angular/controllers/query.js b/solr/webapp/web/js/angular/controllers/query.js
index 3f0fb27..8e89778 100644
--- a/solr/webapp/web/js/angular/controllers/query.js
+++ b/solr/webapp/web/js/angular/controllers/query.js
@@ -67,14 +67,19 @@ solrAdminApp.controller('QueryController',
         }
       }
 
-      var qt = $scope.qt ? $scope.qt : "select";
+      var qt = $scope.qt ? $scope.qt : "/select";
 
       for (var filter in $scope.filters) {
         copy(params, $scope.filters[filter]);
       }
 
       params.core = $routeParams.core;
-      params.handler = qt;
+      if (qt[0] == '/') {
+        params.handler = qt.substring(1);
+      } else { // Support legacy style handleSelect=true configs
+        params.handler = "select";
+        set("qt", qt);
+      }
       var url = Query.url(params);
       Query.query(params, function(data) {
         $scope.lang = $scope.query.wt;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6ca664db/solr/webapp/web/js/angular/services.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/angular/services.js b/solr/webapp/web/js/angular/services.js
index 13d01f7..014d36b 100644
--- a/solr/webapp/web/js/angular/services.js
+++ b/solr/webapp/web/js/angular/services.js
@@ -212,7 +212,7 @@ solrAdminServices.factory('System',
   }])
 .factory('Query',
     ['$resource', function($resource) {
-       var resource = $resource('/solr/:core:handler', {core: '@core', handler: '@handler', '_':Date.now()}, {
+       var resource = $resource('/solr/:core/:handler', {core: '@core', handler: '@handler', '_':Date.now()}, {
            "query": {
              method: "GET",
              transformResponse: function (data) {
@@ -230,7 +230,7 @@ solrAdminServices.factory('System',
                    }
                }
            }
-           return "/solr/" + params.core + params.handler + "?" + qs.sort().join("&");
+           return "/solr/" + params.core + "/" + params.handler + "?" + qs.sort().join("&");
        }
        return resource;
 }])