I’d like to request a feature related to quick searching, but with broader functionality than the previously mentioned embedded quick-search requests.
Overview of the Proposed Feature
- Add a new “Search Block” that can be placed anywhere (e.g., on a dashboard or a separate page).
- Allow searching across multiple collections (database-wide), with configurable fields to search and the ability to set “weights” (priorities) for each field.
- Include best practice search triggers (for example, only start searching after the user has typed 2-3 characters, or after a short delay).
Use Case Example
Suppose I have three tables:
- Vendors (fields:
name
,details
) - Products (fields:
name
,details
) - Specifications (fields:
name
,manufacturer
)
I want a single search box that:
- Searches
vendors.name
,products.name
, andspecifications.name
with a weight of 1. - Searches
vendors.details
with a weight of 0.8. - Searches
products.details
with a weight of 0.5. - Searches
specifications.manufacturer
with a weight of 0.25.
How the Search Might Work
- User types a query in the search box.
- The system scans multiple collections and their configured fields.
- Each field match contributes to a total score for each record, based on the defined weights.
- The results are ranked either by this score (descending) or alphabetically (or both options could be available).
- Results are displayed in a list (e.g., “Vendor: ACME,” “Product: Dynamo Widget,” etc.).
URL Routing and Nested Data
Because NocoBase doesn’t currently support deep hierarchical routing in a straightforward way, we need a system to define how to build URLs for each type of record.
For example, if each table is on a separate admin page:
- A Vendor result might link to:
/admin/a0a0aaaaa0a?vendor=ID
- A Product result might link to:
/admin/b1b1bbbbb1b?vendor=VENDOR_ID&product=PRODUCT_ID
- A Specification result might link to:
/admin/c2c2ccccc2c?vendor=VENDOR_ID&product=PRODUCT_ID&specification=SPEC_ID
The search configuration could define the URL pattern for each collection. The system would swap in the correct IDs automatically.
Additional Considerations
- Configurable Minimum Characters: For instance, don’t run the search until the user types at least 2 characters.
- Delay / Debounce: Optionally wait a few hundred milliseconds before starting a search, so we don’t overwhelm the server on every keystroke.
- Advanced Weighting: Provide a user-friendly way to define weights (for example, fields with a higher weight are considered more important and appear higher in the results).
Why This is Needed
Currently, NocoBase has no filtering mechanism that can search across collections. A dedicated, global search feature:
- Speeds up data retrieval for end users.
- Simplifies multi-collection searching, removing the need to open each table separately to find related records.
- Reduces clicks and complexity compared to manually configuring filters in the UI builder each time.