[Management] Ensure we do not perform an empty ccs query (#15372) (#15394)

* Ensure we do not peform an empty ccs query

* Trim in case there is extra whitespace
This commit is contained in:
Chris Roberson 2017-12-04 16:51:35 -05:00 committed by GitHub
parent cb3336f990
commit df0d679ea8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,7 +77,17 @@ uiModules.get('apps/management')
});
}
function getIndices(pattern, limit = MAX_SEARCH_SIZE) {
function getIndices(rawPattern, limit = MAX_SEARCH_SIZE) {
const pattern = rawPattern.trim();
// Searching for `*:` fails for CCS environments. The search request
// is worthless anyways as the we should only send a request
// for a specific query (where we do not append *) if there is at
// least a single character being searched for.
if (pattern === '*:') {
return [];
}
const params = {
index: pattern,
ignore: [404],