{"record":{"id":"9946fb59d4931786","repo":"quickwit-oss/quickwit","slug":"index-id-pattern-pattern-is-invalid-patterns","errorCode":null,"errorMessage":"index ID pattern `{pattern}` is invalid: patterns must match the following regular expression: `^[a-zA-Z\\*][a-zA-Z0-9-_\\.\\*]{{0,254}}$`","messagePattern":"index ID pattern `(.+?)` is invalid: patterns must match the following regular expression: `\\^\\[a-zA-Z\\\\\\*\\]\\[a-zA-Z0-9-_\\\\\\.\\\\\\*\\](.+?)\\}\\$`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-config/src/lib.rs","lineNumber":175,"sourceCode":"/// chars to allow for glob-like patterns.\npub fn validate_index_id_pattern(pattern: &str, allow_negative: bool) -> anyhow::Result<()> {\n    static IDENTIFIER_REGEX_WITH_GLOB_PATTERN: LazyLock<Regex> = LazyLock::new(|| {\n        Regex::new(r\"^[a-zA-Z\\*][a-zA-Z0-9-_\\.\\*]{0,254}$\")\n            .expect(\"regular expression should compile\")\n    });\n    static IDENTIFIER_REGEX_WITH_GLOB_PATTERN_NEGATIVE: LazyLock<Regex> = LazyLock::new(|| {\n        Regex::new(r\"^-?[a-zA-Z\\*][a-zA-Z0-9-_\\.\\*]{0,254}$\")\n            .expect(\"regular expression should compile\")\n    });\n\n    let regex = if allow_negative {\n        &IDENTIFIER_REGEX_WITH_GLOB_PATTERN_NEGATIVE\n    } else {\n        &IDENTIFIER_REGEX_WITH_GLOB_PATTERN\n    };\n\n    if !regex.is_match(pattern) {\n        bail!(\n            \"index ID pattern `{pattern}` is invalid: patterns must match the following regular \\\n             expression: `^[a-zA-Z\\\\*][a-zA-Z0-9-_\\\\.\\\\*]{{0,254}}$`\"\n        );\n    }\n    // Forbid multiple stars in the pattern to force the user making simpler patterns\n    // as multiple stars does not bring any value.\n    if pattern.contains(\"**\") {\n        bail!(\n            \"index ID pattern `{pattern}` is invalid: patterns must not contain multiple \\\n             consecutive `*`\"\n        );\n    }\n    // If there is no star in the pattern, we need at least 3 characters.\n    if !pattern.contains('*') && pattern.len() < 3 {\n        bail!(\n            \"index ID pattern `{pattern}` is invalid: an index ID must have at least 3 characters\"\n        );\n    }","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-config/src/lib.rs#L157-L193","documentation":"`validate_index_id_pattern` checked the candidate pattern (used for glob-like index matching in delete/search APIs) against the identifier-with-glob regex; it must start with a letter or `*`, may then contain letters, digits, `-`, `_`, `.`, or `*`, and be at most 255 characters. The given pattern violates one of these rules.","triggerScenarios":"Thrown at quickwit/quickwit-config/src/lib.rs:175 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Start the pattern with a letter or `*` (not a digit or symbol)","Use only `a-zA-Z0-9-_.` and `*` characters in the rest of the pattern","Keep the pattern under 255 characters"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a39730c5cdcd1a4fe798403737ae293999ea21f8","analyzedAt":"2026-09-08T13:19:37.784Z","contentChangedAt":"2026-09-08T13:19:37.784Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}