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

fix(types): fields in experimental.search can be optional #2506

Merged
merged 2 commits into from Jan 17, 2024

Conversation

antfu
Copy link
Member

@antfu antfu commented Jan 16, 2024

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

The default value has been assigned here:

content/src/module.ts

Lines 528 to 550 in 12d2670

const defaultSearchOptions: Partial<ModuleOptions['experimental']['search']> = {
indexed: true,
ignoredTags: ['style', 'code'],
filterQuery: { _draft: false, _partial: false },
options: {
fields: ['title', 'content', 'titles'],
storeFields: ['title', 'content', 'titles'],
searchOptions: {
prefix: true,
fuzzy: 0.2,
boost: {
title: 4,
content: 2,
titles: 1
}
}
}
}
options.experimental.search = {
...defaultSearchOptions,
...options.experimental.search
}

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link

cloudflare-pages bot commented Jan 16, 2024

Deploying with Β Cloudflare Pages Β Cloudflare Pages

Latest commit: cc7764b
Status:Β βœ…Β  Deploy successful!
Preview URL: https://df8dab5c.nuxt-content-1il.pages.dev
Branch Preview URL: https://fix-search-types.nuxt-content-1il.pages.dev

View logs

@farnabaz farnabaz merged commit 2d7188b into main Jan 17, 2024
3 checks passed
@farnabaz farnabaz deleted the fix/search-types branch January 17, 2024 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants