A custom NocoBase plugin that adds a global cross-collection search feature to the admin interface.
- Magnifying glass icon in the admin header — always one click away
- Search across multiple collections simultaneously using a configurable LIKE/contains query
- Results table with Name, Collection, and a "View Record" button that opens the record detail in a new tab
- Configurable per-collection URL templates for the "View Record" link (e.g.
/admin/{pageId}?popupuid={id}) - Admin settings page for managing which collections are searchable and how their links are constructed
The plugin is a full-stack NocoBase package with both client and server components.
src/
├── index.ts # Server entry point
├── client/
│ ├── index.tsx # Client plugin class
│ ├── GlobalSearchProvider.tsx # Registers the header icon
│ ├── components/
│ │ ├── GlobalSearchButton.tsx # Magnifying glass button in the header
│ │ └── GlobalSearchModal.tsx # Search modal with input + results table
│ └── settings/
│ └── GlobalSearchSettings.tsx # Admin settings page
└── server/
├── index.ts # Server plugin class
├── collections/
│ └── global-search-configs.ts # DB collection for storing search config
└── resourcers/
└── global-search.ts # Custom API endpoint: globalSearch:search
PluginGlobalSearchClient.load()registersGlobalSearchProvideras a React provider viaapp.use().GlobalSearchProvideruses NocoBase'sPinnedPluginListProviderto inject aGlobalSearchButtoninto the admin header icon row, andSchemaComponentOptionsto make the component available to the schema renderer.- Clicking the button opens
GlobalSearchModal— an Ant Design Modal containing anInput.Searchand a resultsTable. - On search, the modal calls
GET /api/globalSearch:search?q=<query>viauseAPIClient. Results are displayed with columns for Name, Collection, and a "View Record" button. - The "View Record" URL is built from the per-collection
urlTemplatestored in the database, with{id}replaced by the record's primary key.
PluginGlobalSearchServer.load()registers a custom resource (globalSearch) with asearchaction, and sets ACL rules to allow authenticated users to call it.- The
searchaction reads enabled configurations from theglobalSearchConfigscollection, then runs a parallel$includes(LIKE) query against each configured collection's search field. - Results from all collections are merged into a flat array and returned. NocoBase's
dataWrappingmiddleware automatically wraps the response into{ data: [...] }. - CRUD access to
globalSearchConfigsis allowed for admin users so the settings page can manage configurations.
Registered under Settings → Global Search via pluginSettingsManager.add(). Admins can:
- Add collections to the search index (choosing from all available collections)
- Set a display name, the field to search on, and the URL template for "View Record" links
- Enable/disable individual collections
- Edit or remove configurations
| Plugin version | NocoBase version |
|---|---|
| 2.0.0 | 2.0.41+ |
Note: This plugin was developed and tested against NocoBase v2.0.41. It is not compatible with earlier versions (notably v2.0.8 and below) due to internal API differences in
@nocobase/client.
- Download the pre-built
.tgzfrom the Releases page (or from theplugin-global-search-2.0.0.tgzfile in this repo). - In your NocoBase admin UI, go to Settings → Plugin Manager.
- Click Add plugin → Upload local plugin and select the
.tgzfile. - Click Activate.
- Do a hard refresh (
Cmd+Shift+R/Ctrl+Shift+R) to ensure the browser loads the new client bundle.
Requires the full NocoBase monorepo development environment.
# Clone the NocoBase monorepo and place this plugin under:
# packages/plugins/@nocobase/plugin-global-search/
# Install dependencies
yarn install
# Build the plugin
yarn build @nocobase/plugin-global-search
# Package it as a .tgz for upload
yarn nocobase tar @nocobase/plugin-global-search
# → creates storage/tar/@nocobase/plugin-global-search-2.0.0.tgzThen follow Option 1 to install the generated .tgz.
After activation:
- Go to Settings → Global Search.
- Click Add Collection to configure a collection for search.
- For each collection, set:
- Collection — select from your existing NocoBase collections
- Display Name — label shown in search results (e.g. "Customers")
- Search Field — the field name to run the LIKE query against (e.g.
name,title) - URL Template — the path opened when "View Record" is clicked. Use
{id}as a placeholder for the record's primary key. Example:/admin/your-page-id?popupuid={id} - Enabled — toggle to include/exclude from search without deleting the config
Apache-2.0