Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please allow searchContent config to take custom frontmatter fields instead of just 'title' #2801

Open
clairep94 opened this issue Oct 2, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@clairep94
Copy link

Is your feature request related to a problem? Please describe

I am working on a public API docs site for my company which uses Nuxt Content md files to create all the page contents.
I want to be able to search the docs using custom frontmatter properties, instead of just 'title'.

Describe the solution you'd like

content: {
    experimental: {
      search: {
        options: {
          fields: ['title', 'titles', 'customFrontmatterField'], // I want to be able to add a custom front matter property name here
          storeFields: ['title', 'titles'],
          searchOptions: {
            prefix: true,
            fuzzy: 0.2,
            boost: {
              title: 4,
              content: 2,
              titles: 1
            }
          }
        }
      },
      clientDB: true,
    }
  }, 

Describe alternatives you've considered

I can search by content, but there is some stuff in frontmatter that are not in the content. For example tags

Additional context

@clairep94 clairep94 added the enhancement New feature or request label Oct 2, 2024
@thienguen
Copy link

Having trouble with a similar problem, the docs show it was a t/f problem, so I got confused as well. https://content.nuxt.com/get-started/configuration#search

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants