The rendering behavior of the search results from a datasource are determined by 3 ways (in increasing order of preference):
Datasource categories are set for a datasource during the data source setup phase (or /adddatasource
endpoint). The field is typically set for all custom data sources. For information on the meaning of each category, refer to this document: Selecting datasource category
With no further action required from the developer, we will aim to render results from the datasource of the specified datasource categories with information typically surfaced in results from that category.
We have specific default rendering behaviour for the following datasource categories:
PUBLISHED_CONTENT
KNOWLEDGE_HUB
For other categories, the rendering would be a vanilla icon + title + snippet (see screenshot below).
Contact glean support to further customize rendering for your datasource (option 2).
Results from datasources with the datasourceCategory set to PUBLISHED_CONTENT
would include the last updated time, author and container (if any) in the meta line.
Similar to PUBLISHED_CONTENT
, datasources with KNOWLEDGE_HUB
would include the last updated time, owner (instead of author) and container (if any) in the meta line.
Datasources with the above 2 categories, typically look like the following:
Currently, this step requires contacting glean support to get the behaviour support.
Examples of requests include:
For now, this will be setup by Glean internally - but in the future we expect to enable admins/developers to configure this themselves via the Glean admin console.
Here is an example of customized rendering for a search result:
The example above is for an internal job portal datasource and shows how we can add custom attributes like level, location, job role, engineering manager (as a person field).
To do this, you can set the renderConfigPreset in the datasource config (when making /adddatasource calls or setting up a datasource via the admin console).
This field can be set to the name of any datasource supported by glean (in lower case). While it is recommended to contact Glean support to help get this setup - some of the common values used for this field include:
If you want to go back to using the default rendering behaviour (option 1) OR the custom rendering setup through option 2, you must unset the renderConfigPreset in the datasource config.