Fix some related content issues with content adapters

Fixes #13443
This commit is contained in:
Bjørn Erik Pedersen
2025-02-25 11:28:59 +01:00
parent 227e429267
commit 381c0da85d
8 changed files with 151 additions and 16 deletions

View File

@@ -151,6 +151,20 @@ func (p *pageState) Key() string {
return "page-" + strconv.FormatUint(p.pid, 10)
}
// RelatedKeywords implements the related.Document interface needed for fast page searches.
func (p *pageState) RelatedKeywords(cfg related.IndexConfig) ([]related.Keyword, error) {
v, found, err := page.NamedPageMetaValue(p, cfg.Name)
if err != nil {
return nil, err
}
if !found {
return nil, nil
}
return cfg.ToKeywords(v)
}
func (p *pageState) resetBuildState() {
// Nothing to do for now.
}