Skip to content

Commit

Permalink
minor shrink fix
Browse files Browse the repository at this point in the history
  • Loading branch information
awick committed Oct 18, 2019
1 parent 37ad1c0 commit f88ef94
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions viewer/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3378,10 +3378,14 @@ app.post('/esindices/:index/open', logAction(), checkCookieToken, function(req,

app.post('/esindices/:index/shrink', logAction(), checkCookieToken, (req, res) => {
if (!req.user.createEnabled) { return res.molochError(403, 'Need admin privileges'); }
if (!req.body || !req.body.target) {
return res.molochError(403, 'Missing target');
}

let settingsParams = {
body: {
'index.routing.allocation.require._name': req.query.target,
'index.routing.allocation.total_shards_per_node': null,
'index.routing.allocation.require._name': req.body.target,
'index.blocks.write': true
}
};
Expand All @@ -3400,7 +3404,7 @@ app.post('/esindices/:index/shrink', logAction(), checkCookieToken, (req, res) =
'index.routing.allocation.require._name': null,
'index.blocks.write': null,
'index.codec': 'best_compression',
'index.number_of_shards': req.query.numShards || 1
'index.number_of_shards': req.body.numShards || 1
}
}
};
Expand Down

0 comments on commit f88ef94

Please sign in to comment.