Files
payloadcms/docs
Paul 2bc8666bff feat(plugin-search)!: make search collection fields override into a function that provides defaultFields inline with other plugins (#7095)
searchPlugin's searchOverrides for the collection now takes in a fields
function instead of array similar to other plugins and patterns we use
to allow you to map over existing fields as well if needed.

```ts
// before
searchPlugin({
  searchOverrides: {
    slug: 'search-results',
    fields: [
      {
        name: 'excerpt',
        type: 'textarea',
        admin: {
          position: 'sidebar',
        },
      },
    ]
  },
}),

// current
searchPlugin({
  searchOverrides: {
    slug: 'search-results',
    fields: ({ defaultFields }) => [
      ...defaultFields,
      {
        name: 'excerpt',
        type: 'textarea',
        admin: {
          position: 'sidebar',
        },
      },
    ]
  },
}),
```
2024-07-10 15:22:12 +00:00
..
2024-06-25 10:38:12 -04:00
2024-05-13 10:29:59 -04:00
2024-06-27 21:22:01 +00:00
2024-06-24 14:12:50 -04:00
2024-06-24 13:57:01 -04:00
2024-05-13 10:29:59 -04:00
2024-06-24 13:17:50 -04:00