Open GulomovCreative opened 1 year ago
Should be possible using something like this (ignore ts errors, if any):
import { defineConfig } from 'vitepress'
export default defineConfig({
themeConfig: {
search: {
provider: 'local',
options: {
miniSearch: {
options: {
fields: ['title', 'titles', 'text', 'category'],
storeFields: ['title', 'titles', 'category'],
extractField(document, fieldName) {
if (fieldName === 'category') return getCategory(document)
return document[fieldName]
}
},
searchOptions: {
/* ... */
}
}
}
}
}
})
Is your feature request related to a problem? Please describe.
At this moment, we have no way to somehow influence the fields being added to the local search index, except to write new solution. It would be more convenient if it was possible to change and/or add fields in a hook similar to transformData
Describe the solution you'd like
Describe alternatives you've considered
No response
Additional context
No response
Validations