Skip to content

Commit

Permalink
docs: improve docs about beforeSync in searchPlugin (#8946)
Browse files Browse the repository at this point in the history
This clarification was made to prevent anyone from wasting time on this
again:

#5173
  • Loading branch information
GermanJablo authored Oct 31, 2024
1 parent 3175541 commit 4246b36
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/plugins/search.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ Before creating or updating a search record, the `beforeSync` function runs. Thi
searchPlugin({
beforeSync: ({ originalDoc, searchDoc }) => ({
...searchDoc,
// Modify your docs in any way here, this can be async
// - Modify your docs in any way here, this can be async
// - You also need to add the `excerpt` field in the `searchOverrides` config
excerpt: originalDoc?.excerpt || 'This is a fallback excerpt',
}),
}),
Expand Down

0 comments on commit 4246b36

Please sign in to comment.