mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[ES|QL] accept negated index patterns (#184528)
## Summary `*, -.*` is now acceptable. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
This commit is contained in:
parent
4eb175f384
commit
4e8876d6a4
3 changed files with 7 additions and 1 deletions
|
@ -521,7 +521,7 @@ export function columnExists(
|
|||
}
|
||||
|
||||
export function sourceExists(index: string, sources: Set<string>) {
|
||||
if (sources.has(index)) {
|
||||
if (sources.has(index) || index.startsWith('-')) {
|
||||
return true;
|
||||
}
|
||||
return Boolean(fuzzySearch(index, sources.keys()));
|
||||
|
|
|
@ -430,6 +430,11 @@
|
|||
"error": [],
|
||||
"warning": []
|
||||
},
|
||||
{
|
||||
"query": "from *,-.*",
|
||||
"error": [],
|
||||
"warning": []
|
||||
},
|
||||
{
|
||||
"query": "from indexes*",
|
||||
"error": [
|
||||
|
|
|
@ -352,6 +352,7 @@ describe('validation logic', () => {
|
|||
testErrorsAndWarnings(`from *ex*`, []);
|
||||
testErrorsAndWarnings(`from in*ex`, []);
|
||||
testErrorsAndWarnings(`from ind*ex`, []);
|
||||
testErrorsAndWarnings(`from *,-.*`, []);
|
||||
testErrorsAndWarnings(`from indexes*`, ['Unknown index [indexes*]']);
|
||||
|
||||
testErrorsAndWarnings(`from remote-*:indexes*`, []);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue