Coveo Search Data Provider
Coveo Search Data Provider
Coveo Relevance Cloud™ is a cloud-native search platform that provides relevant results across multiple sources in your organization.
The Coveo Search Data Provider connects to your Coveo subscription and displays those results targeted to each user and configurable in LiveTiles Intranet Widgets and Search.
Prerequisites
- Your Coveo organization id
, you can get this value from your Coveo admin portal, by going to Organization setting -> Settings -> Organization -> Information menu as in the preceeding image.
- A Coveo API key with impersonate user permissions. Follow this post to know how to get the API Key.
- Your SharePoint tenant ID
- Your region specific platformUrl. Coveo uses the property
platformUrl
to set the targetted primary region as mentined here thus, it is important to provide the most appropriate value as theplatformUrl
. More about this property can be found here. - LiveTiles support has activated the Coveo functionality for your tenant
Activating the functionality
In order to use the Coveo Data Provider, LiveTiles support needs to enable the functionality for your tenant. You will need to provide LiveTiles your SharePoint tenant ID, Coveo API key as well as the platformUrl from the prerequisites.
Configuration Samples
The following samples require the according Data Source indexed by Coveo.
Coveo Data Providers are configured according to the CoveoDataProviderConfig
Because the Coveo indexed fields are dynamic and heterogenous depending on the crawled source, you currently need to define the propertymappings inline according to your needs and matching item template.
SortCriteria
DataProvider Sample: YouTube content with{
"configTypeKey": "dataProvider_coveo",
"organizationId": "<CoveoOrganizationId>",
"platformUrl": "<Your region specific platformUrl>",
"constantQuery": "@source==\"YouTube\"",
"sortCriteria": [
{
"by": "field",
"field": "ytviewcount",
"order": "descending"
}
],
"propertyMappings": {
"mappings": {
"onClickUrl": "item.clickUri",
"image": {
"type": "'Image'",
"value": "item.raw.ytthumbnailurl"
},
"title": "item.Title",
"video": {
"type": "'Video'",
"value": {
"source": "'Youtube'",
"id": "item.raw.ytvideoid"
}
}
},
"requiredProperties": ["ytthumbnailurl", "ytvideoid"]
},
"connectableKey": "coveo_yt",
"searchHub": "coveo_yt"
}
Search Results WebPart Sample: SharePoint content with Refiners
This sample belongs inside the Hub Config JSON node: header > searchConfig > specificResultsWebParts
{
"id": "search_Coveo",
"title": "Coveo",
"webPart": {
"configTypeKey": "webPart_aggregation",
"itemTemplate": {
"configTypeKey": "searchItemTemplate_document"
},
"layoutTemplate": {
"configTypeKey": "layoutTemplate_flow"
},
"dataProvider": {
"configTypeKey": "dataProvider_coveo",
"organizationId": "<CoveoOrganizationId>",
"constantQuery": "@source==\"SharePoint\"",
"propertyMappings": {
"mappings": {
"onClickUrl": "item.clickUri",
"title": "item.Title",
"subTitle": "item.raw.spsitename",
"image": {
"type": "'Image'",
"value": "null"
}
},
"requiredProperties": ["spsitename"]
},
"refinersConnectableKey": "refinement",
"refiners": [
{
"displayName": "File type",
"propertyName": "filetype",
"type": "SingleChoice"
},
{
"displayName": "Author",
"propertyName": "author",
"type": "MultiChoice"
}
],
"searchText": {
"expression": "_mp.connectable.objects.searchForm"
},
"connectableKey": "coveo_sp",
"searchHub": "coveo_sp"
}
},
"refinement": {
"configTypeKey": "webPart_refinement",
"refinerExpressions": [
"_mp.connectable.objects.coveo_dataProvider.refiners.filetype",
"_mp.connectable.objects.coveo_dataProvider.refiners.author"
]
}
}
Coveo Widget
You can easily configure the Coveo widget by placing the configuration in an empty widget as preceding.
{
"configTypeKey": "widget_coveo",
"isScrollable": true,
"organizationId": "<CoveoOrganizationId>",
"platformUrl": "<Your region specific platformUrl>",
"searchBoxNumberOfSuggestions": 3,
"facets": [
{
"name": "atomic-facet",
"properties": {
"field": "author",
"label": "Authors"
}
},
{
"name": "atomic-date-facet",
"properties": {
"field": "date",
"label": "Date"
}
},
{
"name": "atomic-numeric-facet",
"properties": {
"field": "size",
"label": "File size"
},
"ranges": [
{
"name": "atomic-numeric-range",
"start": 0,
"end": 10
},
{
"name": "atomic-numeric-range",
"start": 10,
"end": 20
},
{
"name": "atomic-numeric-range",
"start": 20,
"end": 30
},
{
"name": "atomic-numeric-range",
"start": 30,
"end": 40
},
{
"name": "atomic-numeric-range",
"start": 40,
"end": 50
}
]
},
{
"name": "atomic-category-facet",
"properties": {
"field": "geographicalhierarchy",
"label": "[World Atlas]",
"enable-facet-search": true
}
}
]
}
To add this wdget, Click on the Edit Page option in the Lightning Bolt icon and then click on the Add New Widget button.
Click on the Add a widget from the catalog option and then select empty widget. A new widget will be created, and clicking on the edit icon on the widget will give you an option to add the above-mentioned configuration.
Please make sure to provide your organization id and platform URL in the configuration. Once you are finished configuring the widget, you can click the apply button and then close.