Skip to content

Commit c9ce350

Browse files
authored
docs(plugin-search): add info on collection reindexing (#9764)
Adds documentation for the feature introduced with [plugin-search collection reindexing](#9391). This also fixes an invalid scss import in one of the examples. Credit to @rilrom for the invalid css import find!
1 parent ef8d3c9 commit c9ce350

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

docs/admin/components.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ Then to colorize your Custom Component's background, for example, you can use th
445445
Payload also exports its [SCSS](https://sass-lang.com) library for reuse which includes mixins, etc. To use this, simply import it as follows into your `.scss` file:
446446

447447
```scss
448-
@import '~payload/scss';
448+
@import '~@payloadcms/ui/scss';
449449
450450
.my-component {
451451
@include mid-break {

docs/plugins/search.mdx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ This plugin is a great way to implement a fast, immersive search experience such
3333
- Allows you to query search results using first-party Payload APIs
3434
- Allows you to query documents without triggering any of their underlying hooks
3535
- Allows you to easily prioritize search results by collection or document
36+
- Allows you to reindex search results by collection on demand
3637

3738
## Installation
3839

@@ -81,7 +82,7 @@ export default config
8182

8283
The `collections` property is an array of collection slugs to enable syncing to search. Enabled collections receive a `beforeChange` and `afterDelete` hook that creates, updates, and deletes its respective search record as it changes over time.
8384

84-
### `localize`
85+
#### `localize`
8586

8687
By default, the search plugin will add `localization: true` to the `title` field of the newly added `search` collection if you have localization enabled. If you would like to disable this behavior, you can set this to `false`.
8788

@@ -159,6 +160,14 @@ When `syncDrafts` is true, draft documents will be synced to search. This is fal
159160

160161
If true, will delete documents from search whose status changes to draft. This is true by default. You must have [Payload Drafts](https://payloadcms.com/docs/versions/drafts) enabled for this to apply.
161162

163+
#### `reindexBatchSize`
164+
165+
A number that, when specified, will be used as the value to determine how many search documents to fetch for reindexing at a time in each batch. If not set, this will default to `50`.
166+
167+
### Collection reindexing
168+
169+
Collection reindexing allows you to recreate search documents from your search-enabled collections on demand. This is useful if you have existing documents that don't already have search indexes, commonly when adding `plugin-search` to an existing project. To get started, navigate to your search collection and click the pill in the top right actions slot of the list view labelled `Reindex`. This will open a popup with options to select one of your search-enabled collections, or all, for reindexing.
170+
162171
## TypeScript
163172

164173
All types can be directly imported:

0 commit comments

Comments
 (0)