epugh commented on code in PR #4177:
URL: https://github.com/apache/solr/pull/4177#discussion_r4108540370
##########
solr/webapp/web/js/angular/controllers/documents.js:
##########
@@ -64,74 +74,57 @@ solrAdminApp.controller('DocumentsController',
};
$scope.submit = function () {
- var contentType = "";
- var postData = "";
- var params = {};
- var doingFileUpload = false;
-
- if ($scope.handler[0] == '/') {
- params.handler = $scope.handler.substring(1);
- } else {
- params.handler = 'update';
- params.qt = $scope.handler;
+ if ($scope.type == "upload") {
+ FileUpload.upload({
+ core: $routeParams.core,
+ handler: "update",
+ commitWithin: $scope.commitWithin,
+ overwrite: $scope.overwrite,
+ wt: "json",
+ raw: $scope.literalParams
+ }, $scope.fileUpload, function (data) {
+ $scope.responseStatus = "success";
+ $scope.response = JSON.stringify(data, null, ' ');
+ }, function (data) {
+ $scope.responseStatus = "failure";
+ $scope.response = JSON.stringify(data, null, ' ');
+ });
+ return;
}
- params.commitWithin = $scope.commitWithin;
- params.overwrite = $scope.overwrite;
- params.core = $routeParams.core;
- params.wt = "json";
-
+ var postData;
+ var updateMethod;
if ($scope.type == "json" || $scope.type == "wizard") {
postData = "[" + $scope.document + "]";
- contentType = "json";
- } else if ($scope.type == "csv") {
+ updateMethod = UpdateV2.update;
+ } else if ($scope.type == "solr-json") {
postData = $scope.document;
- contentType = "csv";
+ updateMethod = UpdateV2.update;
} else if ($scope.type == "xml") {
postData = "<add>" + $scope.document + "</add>";
- contentType = "xml";
- } else if ($scope.type == "upload") {
- doingFileUpload = true;
- params.raw = $scope.literalParams;
- } else if ($scope.type == "solr") {
+ updateMethod = UpdateV2.updateXml;
Review Comment:
Turns out the suggesed fix doesn't do it. HOwever see
4fe0bb2abfac5b962edf22baafa4c4a7278922e3. I also found a "TODO remove wt from
v2" comment in the code, so I am going to open a seperate PR that makes wt= not
work.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]