Skip to content

fix(crawler): use the Markdown front matter title as the document title - #3511

Merged
marevol merged 1 commit into
mainfrom
fix/markdown-front-matter-title
Sep 27, 2026
Merged

marevol merged 1 commit into
mainfrom
fix/markdown-front-matter-title

Conversation

@marevol

@marevol marevol commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Use the title: from a Markdown file's YAML front matter as the document title.

When a .md file that has title: in its front matter is crawled, the indexed title is the file name (for example getting-started.md), not the front matter title.

MarkdownExtractor in fess-crawler already parses the front matter and reports each key as frontmatter.<key>, so the title arrives in the extract data as frontmatter.title (MarkdownExtractor#extractFrontMatterMetadata). On the Fess side, AbstractFessFileTransformer copies extract metadata into the document only through crawler.metadata.name.mapping. That setting maps only title, Title and dc:title, so frontmatter.title was dropped, hasTitle found no title, and the transformer fell back to the file name.

Changes

  • fess_config.properties / FessConfig: add frontmatter.title=title:string to the default crawler.metadata.name.mapping.

A Markdown file without a front matter title keeps the file name as its title, as before. No other front matter keys are mapped.

Tests

  • FessPropTest: with the shipped configuration, frontmatter.title maps to title as string, the existing dc:title mapping is still present, and other front matter keys stay unmapped.
  • mvn -o formatter:format license:format
  • mvn -o test -Dtest='FessPropTest,FessConfigTest,AbstractFessFileTransformerTest,FessFileTransformerTest,FessXpathTransformerTest': 209 tests, 0 failures, 0 errors

The Markdown extractor in fess-crawler reports each YAML front matter
key as "frontmatter.<key>", so a "title:" in the front matter arrives
as frontmatter.title. crawler.metadata.name.mapping only mapped title,
Title and dc:title to the title field, so the value was never used and
the file transformer fell back to the file name (for example
getting-started.md) as the title.

Add frontmatter.title=title:string to the default mapping in
fess_config.properties and FessConfig. A Markdown file without a front
matter title keeps the file name as before.
@marevol marevol added this to the 15.9.0 milestone Sep 27, 2026
@marevol marevol self-assigned this Sep 27, 2026
@marevol
marevol merged commit 7d86fc9 into main Sep 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant