{"record":{"id":"af0058537b2a8751","repo":"quickwit-oss/quickwit","slug":"document-clustering-fingerprint-policy-must-contai","errorCode":null,"errorMessage":"document clustering fingerprint policy must contain at least one field","messagePattern":"document clustering fingerprint policy must contain at least one field","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-config/src/docs_clustering.rs","lineNumber":135,"sourceCode":"    fn validate(&self) -> anyhow::Result<()> {\n        match self {\n            Self::Fingerprint { fingerprint } => {\n                fingerprint.validate()?;\n            }\n        }\n        Ok(())\n    }\n}\n\n#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]\n#[serde(transparent)]\npub struct FingerprintPolicy {\n    pub fingerprint: Vec<ClusteringMethod>,\n}\n\nimpl FingerprintPolicy {\n    fn validate(&self) -> anyhow::Result<()> {\n        ensure!(\n            !self.fingerprint.is_empty(),\n            \"document clustering fingerprint policy must contain at least one field\"\n        );\n        for method in &self.fingerprint {\n            method.validate()?;\n        }\n        Ok(())\n    }\n}\n\n#[repr(transparent)]\n#[derive(Debug, Clone, PartialEq)]\npub struct JsonPath(Box<[String]>);\n\nimpl Serialize for JsonPath {\n    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>\n    where S: Serializer {\n        serializer.serialize_str(&self.0.join(JSON_PATH_SEPARATOR))","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-config/src/docs_clustering.rs#L117-L153","documentation":"Within a document clustering fingerprint policy, `FingerprintPolicy::validate` requires at least one clustering method (field). A fingerprint policy with an empty `fingerprint` list cannot compute any fingerprint and is rejected.","triggerScenarios":"An index config where a policy is declared but its `fingerprint` array is empty (`fingerprint: []`), surfaced through `FingerprintPolicy::validate` when DocsClusteringConfig::validate iterates the policies via build_optional/index creation.","commonSituations":"Templated config with placeholders never filled in; a UI or script filtering out fields but emitting the empty policy; deleting all field entries by hand during tuning.","solutions":["Add at least one clustering method/field entry to the policy's `fingerprint` list (e.g. a field like `level`, `service`).","Remove the whole empty policy from `doc_clustering.policies` if it is not needed.","Validate the fingerprint methods individually too — each entry must itself be a valid ClusteringMethod."],"exampleFix":"# before\n- fingerprint: []\n# after\n- fingerprint:\n    - field: service\n      method: exact","handlingStrategy":"validation","validationCode":"for (const p of config.doc_clustering?.policies ?? []) {\n  if (Array.isArray(p.fingerprint) && p.fingerprint.length === 0) {\n    throw new Error('each fingerprint policy needs at least one field');\n  }\n}","typeGuard":"const isValidFingerprintPolicy = (p) => Array.isArray(p?.fingerprint) && p.fingerprint.length > 0;","tryCatchPattern":null,"preventionTips":["Never emit a policy block without at least one field entry; template placeholders should be filled or removed.","Add a CI lint that walks doc_clustering.policies and checks each fingerprint list is non-empty.","When removing fields from a policy, remove the whole policy if it becomes empty."],"tags":["config","validation","clustering"],"backgroundTag":"empty-required-field","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"}