docusaurus-search-local icon indicating copy to clipboard operation
docusaurus-search-local copied to clipboard

Should search find documents based on front-matter keywords?

Open hatton opened this issue 1 year ago • 1 comments

My pages have, for example:

---
title: Unblocking Bloom from Windows Controlled Folder Access
sidebar_position: 5
slug: /windows-controlled-folder-access
keywords: [troubleshooting, Defender, controlled, folder]
---

I find that search will find terms in the title, but not the keywords. For example, I would expect that if I search for "troubleshooting", this document would be listed. Is there something I can do to start indexing on keywords?

hatton avatar Jul 14 '23 21:07 hatton

➕ On this feature request!

For now, I've just added some hidden content on my page that includes the keyword. Definitely not ideal though.

I would also expect to be able to search over frontmatter tags:

---
title: My title
tags:
  - Foo
  - Bar
---

alexchantastic avatar Oct 12 '23 18:10 alexchantastic

Looking for this behaviour as well.

This is available with https://github.com/praveenn77/docusaurus-lunr-search which I switched from due it's lack of style customization

lyleaigbedion avatar May 20 '24 21:05 lyleaigbedion

It is possible to make search based on keywords, if they are appeared in the generated HTML.

such as:

<meta name="keywords" content="...">

Currently it is not supported, PRs welcome. If no one is interested in, I'll do it once I got time.

weareoutman avatar May 23 '24 02:05 weareoutman

Searching based on keywords (and descriptions) from meta tags (front matter in markdown) is supported via 0.41.0

weareoutman avatar May 23 '24 07:05 weareoutman