You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(parser): DOCParser ignores remove_toc and remove_header_footer configuration #21987
In the Go ingestion pipeline, defaultSetups() (internal/ingestion/component/parser.go:315-319) declares remove_toc: false and remove_header_footer: false for the doc file family:
Additionally, pipeline templates (e.g. ingestion_pipeline_book.json) and the web client (web/src/pages/agent/utils.ts:300-305) configure and send remove_toc and remove_header_footer for FileType.Doc.
However, DOCParser (internal/parser/parser/doc_parser.go):
Does not implement parserSetupConfigurer (ConfigureFromSetup(map[string]any)), causing configureParserFromSetups (internal/ingestion/component/parser_dispatch.go:48-59) to silently skip passing the doc family setup to the parser.
Lacks RemoveTOC and RemoveHeaderFooter fields on the DOCParser struct.
In ParseWithResult, never checks or applies TOC removal (removeTOCWord with extractDOCXOutlines(irJSON) on structured sections, or removeContentsTable on fallback plain text).
As a result, configuring remove_toc: true on .doc documents is inert, and table-of-contents content is not removed.
Expected behavior
DOCParser should implement ConfigureFromSetup(map[string]any), reading remove_toc and remove_header_footer into DOCParser.RemoveTOC and DOCParser.RemoveHeaderFooter.
When RemoveTOC is enabled, ParseWithResult should remove TOC entries using removeTOCWord(sections, extractDOCXOutlines(irJSON), isEnglishItems(sections)) on structured sections, and removeContentsTable(items, isEnglishItems(items)) on plain-text items.
When RemoveHeaderFooter is enabled, ParseWithResult should filter headers and footers using removeDOCXHeaderFooterSections(sections, extractDOCXHeaderFooterTexts(data)).
Observe that DOCParser does not implement parserSetupConfigurer and lacks ConfigureFromSetup, so configureParserFromSetups silently skips it and ParseWithResult never removes TOC.
Activity