Search extensions
One possible extension type is search. Registered search extensions are available when using the search field in the topbar. A search extension can consist of a
list
and a preview
search. The result of a preview
search is shown below the search input field while the list
search result is
An example of a search extension configuration can be found below:
interface SearchExtension {
id: string
type: 'search'
scopes?: ExtensionScope[]
searchProvider: {
id: string
available: boolean
displayName?: string
previewSearch?: SearchPreview // See SearchPreview section below
listSearch?: SearchList // See SearchList section below
}
}
For id
, type
, and scopes
, please see extension base section in top level docs.
The searchProvider
object configures the actual provider. It consist of the following:
id
- Since your extension has anid
and can only have one searchProvider, you can reuse the same valueavailable
- Can be used to programmatically disable/enable any searchProvider, e.g. by dynamically checking backend capabilitiesdisplayName
- Optional, used to add a small hint to indicate the connection between search providers and their corresponding resultspreviewSearch
- See belowlistSearch
- See below
The listSearch object consists of:
component
- Vue component that can render the values from the SearchResult belowsearch(term: string)
- Function that exectues the search, based on a given term. The term is formatted in KQL. Please note that the returned values needs to be formatted to fit eitherSearchResource
orGenericSearchResultItem
type
The previewSearch object extends the listSearch with one additional attribute:
available
- Indicates whether a preview underneath the search bar is available for this search provider