Description
Problem
Entities of some Databases clutter search results:
"Companion" DBs that don't stand on their own
Stats/Workspace
GitHub/Commit
Task Estimation
Auxiliary DBs
Solution
📦 Current API: remove from index
Currently, it's possible to exclude a DB from search indexing entirely via the API:
[
{
"command": "fibery.schema/batch",
"args": {
"commands": [
{
"command": "schema.type/set-meta",
"args": {
"name": "APP_NAME/TYPE_NAME",
"key": "search/disabled",
"value": true
}
}
]
}
}
]
☝️ Don't forget to reindex to see the results: /api/search/reindex
While a workspace is being reindexed, users of the workspace are not necessarily able to find stuff.
New API: filters
Instead of removing a DB from index entirely, we switch to using filters:
migrate data from core to search service
exclude/include certain DBs from search via a new endpoint
We don't save any storage space compared to the old approach, but the filter is applied immediately and doesn't mess with users ability to find things. Also, search performance is the same in both cases.
Search in relation Views' Link is not affected.
UI: workspace settings
1 - Add Search section into Workspace Settings that will have one option so far
Search
Exclude databases from search results.
[multi-select field with selected databases]
~~Excluded databases from search results is just a multi-select field where an admin can select Databases. ~~
🚨? When to re-index? When a new database is added to the list or ask user push the button?
UI
https://www.figma.com/file/GoJ7gfbeBSR5Jfj0NDpOTT/Zauri's-Playground?type=design&node-id=9989%3A15953&mode=design&t=YpvJ2R3giUFFK91f-1
UI: Database context menu
Have the option to exclude or include database items from search via 3-dot menu of a Database on Space page.
UI: search result's context menu (Entity)
Right-click on any Entity to exclude all Entities of this Database from search results.
Since there is no way to easily include Entities back from the same screen, we show a toast:
${database.namePlural} were excluded from search [Undo]
This context menu option only appears for search results, not recent items.
UI: search result's context menu (Database)
Right-click on a DB to exclude all Entities of this Database from search results. Trigger the context menu again to include them back.
One cannot exclude the Database itself, only Entities of a Database.
UI: adjust DB selector in search
:236ccdbd-d4b2-45f1-83c4-4fa49e17122b: Indicate search is disabled for a DB in What
:236ccdbd-d4b2-45f1-83c4-4fa49e17122b:~~ When a DB is chosen, allow to create new Entities but show that search is disabled => allow to enable it (for those with the right permissions)~~
~~Nothing found~~~~ → ~~~~${database.namePlural} are excluded from search results [Include]~~
We ignore the exclusion filter when a DB is explicitly set in What.
Permissions
🦄 A User with update(Type, User) capability for a Database can exclude/include its Entities from search results.
A User who is Creator in Space where a Database belongs to can exclude/include its Entities from search results.
References
Slack