Experimental feature
Studio search config
The global studio search panel (omnisearch) lets you search your content lake for any document that matches your term, or narrow down by filtering your query by schema types.
There may be instances where you don’t want specific documents from appearing in omnisearch.
To hide search results for a particular document type and remove it as a selectable filter:
{
type: 'document',
name: 'author',
fields: [
{name: 'name', type: 'string'},
// ...
],
// Hide all results for authors (and the author document type filter) in omnisearch
__experimental_omnisearch_visibility: false,
// ...
}
- You have workflow-related documents that you don’t wish to expose editors to.
- You want to hide documents that are less frequently used by editors.
- You’re an author of a Sanity plugin that registers its own document schema and would prefer it doesn't appear in user's studios.
Protip
This only affects visibility within the global studio search (‘omnisearch’). Visibility in both reference and cross dataset reference input fields is unaffected.
You can define specific weights on fields/paths for document types.
Since the API is not stable yet, and likely subject to change, it's configurable on the __experimental_search
property for schema document types. Here's an example:
{
type: 'document',
name: 'author',
fields: [
{name: 'name', type: 'string'},
// ...
],
__experimental_search: [
{weight: 1.2, path: 'name'}
]
// ...
}
- The weight is a global multiplier across all document types, so if
name
on typecustomer
has a weight of2
, andname
on typeauthor
has a weight of4
, documents of typeauthor
will be ranked higher than documents of typecustomer
, even if theirname
fields equally matches what the user searched for. - If no search config is specified on a document type, it gets derived from the preview config (which again is derived by default through schema introspection).
- Only fields and paths included in
__experimental_search
will be used when determining search weighting. It acts as a search field allowlist and can be used as a way to ignore specific fields from search. - We have also united the reference search with the global search, so that they both follow the same ranking/weighting rules.