{"record":{"id":"802fa240a464c420","repo":"quickwit-oss/tantivy","slug":"could-not-read-term-dictionary","errorCode":null,"errorMessage":"could not read term dictionary","messagePattern":"could not read term dictionary","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/aggregation/metric/top_hits.rs","lineNumber":301,"sourceCode":"                            .values_for_doc(doc_id)\n                            .map(FastFieldValue::U64)\n                            .collect::<Vec<_>>(),\n                        DynamicColumn::I64(accessor) => accessor\n                            .values_for_doc(doc_id)\n                            .map(FastFieldValue::I64)\n                            .collect::<Vec<_>>(),\n                        DynamicColumn::F64(accessor) => accessor\n                            .values_for_doc(doc_id)\n                            .map(FastFieldValue::F64)\n                            .collect::<Vec<_>>(),\n                        DynamicColumn::Bytes(accessor) => accessor\n                            .term_ords(doc_id)\n                            .map(|term_ord| {\n                                let mut buffer = vec![];\n                                assert!(\n                                    accessor\n                                        .ord_to_bytes(term_ord, &mut buffer)\n                                        .expect(\"could not read term dictionary\"),\n                                    \"term corresponding to term_ord does not exist\"\n                                );\n                                FastFieldValue::Bytes(buffer)\n                            })\n                            .collect::<Vec<_>>(),\n                        DynamicColumn::Str(accessor) => accessor\n                            .term_ords(doc_id)\n                            .map(|term_ord| {\n                                let mut buffer = vec![];\n                                assert!(\n                                    accessor\n                                        .ord_to_bytes(term_ord, &mut buffer)\n                                        .expect(\"could not read term dictionary\"),\n                                    \"term corresponding to term_ord does not exist\"\n                                );\n                                FastFieldValue::Str(String::from_utf8(buffer).unwrap())\n                            })\n                            .collect::<Vec<_>>(),","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/quickwit-oss/tantivy/blob/b5d8deb80c26924e6b007a5b1a7630f35ca64de4/src/aggregation/metric/top_hits.rs#L283-L319","documentation":"Fires in get_document_field_data when materializing sort/hit values for a top_hits aggregation on a Bytes or Str dynamic column. The column stores values as term ordinals; ord_to_bytes(term_ord, ...) is expected to always resolve an ordinal that was just produced by term_ords(doc_id) for the same accessor. Returning None means the term dictionary lookup failed for a valid ordinal, indicating corruption or an inconsistent dictionary, so the panic guards against silently emitting a wrong value.","triggerScenarios":"Thrown at src/aggregation/metric/top_hits.rs:301 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the index for corruption in the term dictionary of the sort field","Re-index the segment if the dictionary files were damaged","Verify the column accessor and term_ords output come from the same open column"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b5d8deb80c26924e6b007a5b1a7630f35ca64de4","analyzedAt":"2026-09-05T13:20:51.521Z","contentChangedAt":"2026-09-05T13:20:51.521Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}