Skip to content

Commit

Permalink
MB-51251: Set UI element numPIndexes correctly
Browse files Browse the repository at this point in the history
+ Use indexPartitions if available, check maxPartitionsPerPIndex
  otherwise .. because indexPartitions takes precedence
  over maxPartitionsPerPIndex.
+ Set numPIndexes to 1 if neither of the two settings are
  available, and this will work alongside ..
    https://review.couchbase.org/c/ns_server/+/171539

Change-Id: If41429c7ae98e329cd46666523b2b74031cc740b
Reviewed-on: https://review.couchbase.org/c/cbft/+/171543
Well-Formed: Build Bot <build@couchbase.com>
Reviewed-by: <thejas.orkombu@couchbase.com>
Reviewed-by: Sreekanth Sivasankaran <sreekanth.sivasankaran@couchbase.com>
Tested-by: Abhinav Dangeti <abhinav@couchbase.com>
  • Loading branch information
abhinavdangeti committed Mar 1, 2022
1 parent a8e3318 commit a05b762
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions ns_server_static/fts/static/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,9 @@ function blevePIndexInitController(initKind, indexParams, indexUI,

if (angular.isDefined(newPlanParamsObj["indexPartitions"])) {
$scope.numPIndexes = newPlanParamsObj["indexPartitions"];
}
if ($scope.numPIndexes == 0) {
// Initialize maxPartitionsPerPIndex to the vbucket count;
// and indexPartitions to 1.
var maxPartitionsPerPIndex = $scope.vbuckets;
} else if (angular.isDefined(newPlanParamsObj["maxPartitionsPerPIndex"])) {
$scope.numPIndexes = Math.ceil($scope.vbuckets/newPlanParamsObj["maxPartitionsPerPIndex"]);
} else {
$scope.numPIndexes = 1;
}
} catch (e) {
Expand Down

0 comments on commit a05b762

Please sign in to comment.