Add or Edit a Slack Source
Add or Edit a Slack Source
Slack workspace administrators can index the content of a Slack workspace and make it searchable to workspace members through a Coveo-powered search interface. To do so, as a member of the Administrators or Content Managers built-in groups, you must create a Slack source in your Coveo organization.
You can index messages, including files and attachments, from specific public and private channels, and choose to index all channel information (separate from message data) and user-profile data. When a member of your Slack workspace clicks a query result in a Coveo-powered search interface, the user is redirected to the corresponding item in Slack.
Your Slack source provides the Coveo organization with authorization to access your Slack workspace items using an OAuth 2.0 access token. The access token is linked to the Slack bot that you create for your source. The Slack bot is installed in your workspace and added to the channels that you want to index.
|
Note
Coveo also offers a Coveo for Slack app that adds a Coveo-powered search interface directly in Slack. You can use the Coveo for Slack app to provide your Slack workspace members with access to your organization’s indexed content, including content indexed using your Slack source, directly in Slack. |
|
Leading practice
The number of items that a source processes per hour (crawling speed) depends on various factors, such as network bandwidth and source configuration. See About Crawling Speed for information on what can impact crawling speed, as well as possible solutions. |
Source Key Characteristics
Features | Supported | Additional information | |
---|---|---|---|
Slack version |
Latest version |
||
Searchable content types |
Messages, channels, user profiles, files, and attachments. |
||
To set an automatic refresh schedule, see Schedule a Source Update. A rescan or rebuild is required to take account of deleted messages, channels, and user profiles, and to retrieve replies to messages. |
|||
To set an automatic rescan schedule, see Schedule a Source Update. Extracts all of the data and indexes new items and existing items with a modified date greater than the date in the index. The data that your source scans depends on the Earliest message to index (in days) option. |
|||
The data that your source scans depends on the Earliest message to index (in days) option. |
|||
Content security options |
|||
Requirements
Prior to creating a new Slack source:
-
Create a Slack bot and install it on your workspace and channels.
-
(Optional) Create a Slack export file that your Slack source uses for the initial build, as well as subsequent rescans and rebuilds, to index your Slack items.
NoteThe use of a Slack export file adds a certain level of complexity to your integration and isn’t required or recommended in most cases. However, this may be a viable option in certain use cases to limit the amount of data that’s crawled by the Slack connector when indexing numerous channels with large numbers of items.
Add or Edit a Slack Source
-
Before you create a new Slack source, ensure that you’ve performed the tasks detailed in the Requirements section.
-
On the Sources (platform-ca | platform-eu | platform-au) page, do one of the following:
-
To create a new source, click Add source, and then click Slack.
-
To edit an existing source, click your Slack source, and then click Edit in the Action bar.
-
-
Specify your source settings in the Add/Edit a Slack Source subpage. Refer to the following sections for detailed information on the source settings:
NoteYou can save your source settings at any time by clicking Add and build source/Add source, or Save and rebuild source/Save.
"Configuration" Tab
In the Add/Edit a Slack Source subpage, the Configuration tab is selected by default. It contains your source’s general and content information, as well as other parameters.
Source Name
Enter a name for your source.
|
Leading practice
A source name can’t be modified once it’s saved, therefore be sure to use a short and descriptive name, using letters, numbers, hyphens ( |
Export Data URL
If you’re using a Slack export file, enter the direct URL of your hosted .zip file. You must modify the URL so that it’s a direct download link. This forces your Slack source to download the export file when indexing.
-
Dropbox
If the original URL is
https://www.dropbox.com/…zip?dl=0
, modify the URL by adding or replacing thedl
parameter at the end of the URL so that it’sdl=1
, such ashttps://www.dropbox.com/…zip?dl=1
. -
Google Drive
Use this URL format:
https://drive.google.com/uc?export=download&id=<DRIVE_FILE_ID>
, whereDRIVE_FILE_ID
is the unique id of your file. If the original URL ishttps://drive.google.com/file/d/123456789/view?usp=sharing
, modify the URL so that it’shttps://drive.google.com/file/uc?export=download&id=123456789
.
|
Note
Your Slack source downloads the export file during each rescan/rebuild. If you delete the export file from your Cloud storage system, or remove the Export Data URL, your source won’t use the export file for subsequent rescans/rebuilds. |
"Authentication" Section
Your Slack source authorizes the Coveo organization to access your workspace items using your Slack bot’s OAuth 2.0 access token.
-
Get your Bot OAuth Token as follows:
-
Access the Your Apps page of the Slack API website.
-
Click the app that’s associated with your Slack bot.
-
Click OAuth & Permissions in the left menu.
-
Under OAuth Tokens for Your Workspace, copy the Bot User OAuth Token.
-
-
In the Authentication section of your Slack source, paste the token in the Access token field.
"Content to Include" Section
Your Slack source automatically indexes the messages from the active public channels to which your Slack bot is added. However, you can modify your source to also index messages from private channels, only a subset of your message history, or other types of items using the options in this section.
|
Notes
|
Option | Description | ||||
---|---|---|---|---|---|
Earliest message to index (in days) |
This option defines the maximum number of days for which your source indexes message data during a build/rebuild or rescan.
The amount of message data present in your Slack channels can be quite large.
Therefore, you can use this option to limit the amount of data that’s scanned and indexed/re-indexed in order to accelerate the indexing operation. If you choose to index Channels and Users, this option doesn’t limit the channel data (separate from messages) and user data that your source indexes. Set the number of days for which to index message data based on when the message is created or modified.
By default, this option is set to If you’re using a Slack export file in your source, be aware that this setting impacts the message data that your source indexes from your export file. For more information and examples, see Interaction With "Earliest Message To Index" Source Option. |
||||
Private channels |
Select this option to index the messages from private channels to which your Slack bot is added.
|
||||
Channels |
Select this option to index every channel in your workspace as a separate item.
When a query matches the channel name, the channel appears as a separate result in a Coveo search interface.
|
||||
Files and attachments |
Select this option to index the files and attachments in messages as separate items.
This allows users to search for filenames or content within a file/attachment.
When a query matches the filename or content of a file, the file appears as a separate result in a Coveo search interface.
If this option is disabled, files and attachments aren’t indexed, and therefore aren’t searchable in a Coveo search interface. Your source is configured to index the most common file types by default, such as |
||||
Bot messages |
Select this option to index Slack bot and integration messages. |
||||
Users |
Select this option to index the user profiles in your workspace. When a query matches a name or display name in Slack, the user appears as a separate result in a Coveo search interface. When combined with the Files and attachments option, users can filter search results based on the document author. |
||||
Deleted and archived users |
This option appears only if you chose to index Users. If so, you can also choose to index the user profiles of deleted and archived users in your workspace. |
|
Note
If you archive a previously indexed Slack channel, your source removes all corresponding data from the index following a rescan or rebuild. |
"Channels to Index" Section
This section lists all the Slack channels to which your Slack bot is added.
Your Slack source indexes the messages for the channels that contain your Slack bot. Therefore, you can use this section as a reference to see which channels are indexed from your Slack workspace.
|
Note
The list of channels corresponds to the Slack bot that’s associated with the access token you entered in the Authentication section. The channel list populates only after you save the Slack source. |
"Content Security" Tab
Select who will be able to access the source items through a Coveo-powered search interface. For details on this parameter, see Content Security.
|
Note
We recommend selecting the Same users and groups as in your content system option to ensure that workspace content is accessible only by intended users based on your Slack permission system. With this option enabled, an active Slack workspace member has access to message data for all public channels in the workspace, but only for private channels in which they’re a member. |
|
When using the Everyone content security option, see Safely Apply Content Filtering for information on how to ensure that your source content is safely filtered and only accessible by intended users. |
"Access" Tab
In the Access tab, set whether each group and API key can view or edit the source configuration (see Resource Access):
-
If available, in the left pane, click Groups or API Keys to select the appropriate list.
-
In the Access Level column for groups or API keys with access to source content, select View or Edit.
Enable Result Folding for Slack Threads
To display replies from a Slack thread in your search results and group the replies with the original message, you must enable result folding in your search page. This enhances the end-user experience as users expect query results that belong to the same conversation to be displayed in such a way that the original message is represented as the parent of each subsequent reply.
The following image shows replies in a Slack thread grouped under the parent message in a search page with result folding enabled.

|
Note
The Coveo for Slack app search interface doesn’t support result folding, therefore replies appear as separate items in search results. |
If you’re using a classic hosted search page or the JavaScript Search Framework for your search interface, you must use the FoldingForThread
component to enable result folding in your search page.
Your Slack source includes default preconfigured fields (foldingcollection
, foldingchild
, and foldingparent
) in your index for use with your result folding implementation.
|
Note
For hosted search pages, a |
If you’re using Headless or REST API for your search interface, refer to the corresponding documentation for information on how to implement result folding in search results:
-
Headless: FoldedResultList
-
REST API: Handling Folded Results
Verify and Edit Your Source Fields and Mappings
Mappings define what Coveo index fields contain for each source item. Your Slack source automatically includes mapping rules for the fields that are indexed.
The default mapping rules are suitable in most instances, however you can modify the mappings as required.
Do one or both of the following to verify and edit your field mappings:
-
Access the mapping panel for your source, and then review and edit the mappings as required.
-
Build your source, use the Content Browser search interface to inspect the content indexed for your source, and then edit the mappings as required.
Create Additional Source Fields and Mappings (Optional)
In certain situations, you may want to create a field in addition to the fields that are created automatically by your source. For example, you may want to create a field that’s used across multiple sources and mapped to different metadata for each source, or you may want to create a field that aggregates multiple metadata for a single source.
To create additional fields and mappings:
-
Add a field to the Coveo index manually.
-
Create a mapping rule in each source that you want to use the new field.
Safely Apply Content Filtering
The best way to ensure that your indexed content is seen only by the intended users is to enforce content security by selecting the Same users and groups as in your content system option. Should this option be unavailable, select Specific users and groups instead.
However, if you need to configure your source so that the indexed source content is accessible to Everyone, you should adhere to the following leading practices to ensure that your source content is safely filtered and only accessible by the appropriate users:
-
Configure query filters: Apply filter rules on a query pipeline to filter the source content that appears in search results when a query goes through that pipeline.
-
Use condition-based query pipeline routing: Apply a condition on a query pipeline to make sure that every query originating from a specific search hub is routed to the right query pipeline.
-
Configure the search token: Authenticate user queries via a search token that’s generated server side that enforces a specific search hub.
Following the above leading practices results in a workflow whereby the user query is authenticated server side via a search token that enforces the search hub from which the query originates. Therefore, the query can’t be modified by users or client-side code. The query then passes through a specific query pipeline based on a search hub condition, and the query results are filtered using the filter rules.
Configure Query Filters
Filter rules allow you to enter hidden query expressions to be added to all queries going through a given query pipeline.
They’re typically used to add a field-based expression to the constant query expression (cq
).
You apply the @objectType=="Solution"
query filter to the pipeline to which the traffic of your public support portal is directed.
As a result, the @objectType=="Solution"
query expression is added to any query sent via this support portal.
Therefore, if a user types Speedbit watch wristband
in the searchbox, the items returned are those that match these keywords and whose objectType
has the Solution
value.
Items matching these keywords but having a different objectType
value aren’t returned in the user’s search results.
To learn how to configure query pipeline filter rules, see Manage Filter Rules.
|
Note
You can also enforce a filter expression directly in the search token. |
Use Condition-Based Query Pipeline Routing
The most recommended and flexible query pipeline routing mechanism is condition-based routing.
When using this routing mechanism, you ensure that search requests are routed to a specific query pipeline according to the search interface from which they originate, and the authentication is done server side.
To accomplish this:
-
Apply a condition to a query pipeline based on a search hub value, such as Search Hub is Community Search or Search Hub is Agent Panel. This condition ensures that all queries that originate from a specific search hub go through that query pipeline.
-
Authenticate user queries via a search token that’s generated server side and that contains the search hub parameter that you specified in the query pipeline.
Configure the Search Token
When using query filters to secure content, the safest way to enforce content security is to authenticate user queries using a search token that’s generated server side. For instance, when using this approach, you can enforce a search hub value in the search token. This makes every authenticated request that originates from a component use the specified search hub, and therefore be routed to the proper query pipeline. Because this configuration is stored server side and encrypted in the search token, it can’t be modified by users or client-side code.
Implementing search token authentication requires you to add server side logic to your web site or application. Therefore, the actual implementation details will vary from one project to another.
The following procedure provides general guidelines:
|
Note
If you’re using the Coveo In-Product Experience (IPX) feature, see Implementing Advanced Search Token Authentication. |
-
Authenticate the user.
-
Call a service exposed through Coveo to request a search token for the authenticated user.
-
Specify the
userIDs
for the search token, and enforce asearchHub
parameter in the search token.
|
Note
You can specify other parameters in the search token, such as a query |
For more information and examples, see Search Token Authentication.
Build or Rebuild Your Source
You must build the source in order for Coveo to retrieve the source content and apply changes to your source settings. You can build or rebuild your source as follows:
-
You can choose to build when saving the source by clicking Add and build source/Save and rebuild source.
-
If you chose not to build when saving your source settings, you can build your source directly from the Sources (platform-ca | platform-eu | platform-au) page by clicking Launch build in the Status column for your source. If Launch build doesn’t appear on the Sources (platform-ca | platform-eu | platform-au) page for your source, click the source, and then click More > Rebuild in the Action bar.
Once the source is built, you can review its content in the Content Browser.