Overview
The Slack Connector provides functionality to retrieve channel messages from Slack workspaces and register them in the Fess index.
This feature requires the fess-ds-slack plugin.
Supported Content
Public channel messages
Private channel messages
File attachments (optional)
Prerequisites
Plugin installation is required
Slack App creation and permission configuration is required
OAuth Access Token must be obtained
Plugin Installation
Install from the admin console under “System” -> “Plugins”:
Download
fess-ds-slack-X.X.X.jarfrom Maven CentralUpload and install from the plugin management screen
Restart Fess
Or, see Plugin for details.
Configuration
Configure in the admin console under “Crawler” -> “Data Store” -> “Create New”.
Basic Settings
| Item | Example |
|---|---|
| Name | Company Slack |
| Handler Name | SlackDataStore |
| Enabled | On |
Parameter Configuration
token=xoxp-your-token-here
channels=general,random
file_crawl=false
include_private=false
Parameter List
| Parameter | Required | Description |
|---|---|---|
token | Yes | Slack app OAuth Access Token |
channels | Yes | Target channels for crawling (comma-separated, or *all) |
file_crawl | No | Also crawl files (default: false) |
include_private | No | Include private channels (default: false) |
Script Configuration
title=message.user + " #" + message.channel
digest=message.text + "\n" + message.attachments
content=message.text
created=message.timestamp
timestamp=message.timestamp
url=message.permalink
Available Fields
| Field | Description |
|---|---|
message.text | Message text content |
message.user | Message sender’s display name |
message.channel | Channel name where message was sent |
message.timestamp | Message sent date/time |
message.permalink | Message permalink |
message.attachments | Attachment fallback information |
Slack App Configuration
1. Create Slack App
Access https://api.slack.com/apps:
Click “Create New App”
Select “From scratch”
Enter app name (e.g., Fess Crawler)
Select workspace
Click “Create App”
2. Configure OAuth & Permissions
In the “OAuth & Permissions” menu:
Add to Bot Token Scopes:
For public channels only:
channels:history- Read public channel messageschannels:read- Read public channel information
When including private channels (include_private=true):
channels:historychannels:readgroups:history- Read private channel messagesgroups:read- Read private channel information
When also crawling files (file_crawl=true):
files:read- Read file content
3. Install the App
In the “Install App” menu:
Click “Install to Workspace”
Review permissions and click “Allow”
Copy the “Bot User OAuth Token” (starts with
xoxb-)
Note
Normally use the Bot User OAuth Token that starts with xoxb-, but User OAuth Token starting with xoxp- can also be used in parameters.
4. Add to Channels
Add the app to target channels for crawling:
Open the channel in Slack
Click on the channel name
Select the “Integrations” tab
Click “Add apps”
Add the created app
Usage Examples
Crawl Specific Channels
Parameters:
token=xoxb-your-slack-bot-token-here
channels=general,random,tech-discussion
file_crawl=false
include_private=false
Script:
title=message.user + " #" + message.channel
digest=message.text + "\n" + message.attachments
content=message.text
created=message.timestamp
timestamp=message.timestamp
url=message.permalink
Crawl All Channels
Parameters:
token=xoxb-your-slack-bot-token-here
channels=*all
file_crawl=false
include_private=false
Script:
title=message.user + " #" + message.channel
content=message.text
created=message.timestamp
url=message.permalink
Crawl Including Private Channels
Parameters:
token=xoxb-your-slack-bot-token-here
channels=*all
file_crawl=false
include_private=true
Script:
title=message.user + " #" + message.channel
digest=message.text
content=message.text + "\nAttachments: " + message.attachments
created=message.timestamp
url=message.permalink
Crawl Including Files
Parameters:
token=xoxb-your-slack-bot-token-here
channels=general,random
file_crawl=true
include_private=false
Script:
title=message.user + " #" + message.channel
content=message.text
created=message.timestamp
url=message.permalink
Include Detailed Message Information
Script:
title="[" + message.channel + "] " + message.user
content=message.text
digest=message.text.substring(0, Math.min(200, message.text.length()))
created=message.timestamp
timestamp=message.timestamp
url=message.permalink
Troubleshooting
Authentication Error
Symptom: invalid_auth or not_authed
Check:
Verify token is copied correctly
Verify token format:
Bot User OAuth Token: starts with
xoxb-User OAuth Token: starts with
xoxp-
Verify app is installed to workspace
Verify required permissions are granted
Channel Not Found
Symptom: channel_not_found
Check:
Verify channel name is correct (# is not needed)
Verify app is added to the channel
For private channels, set
include_private=trueVerify channel exists and is not archived
Cannot Retrieve Messages
Symptom: Crawl succeeds but 0 messages found
Check:
Verify required scopes are granted:
channels:historychannels:readFor private channels:
groups:history,groups:read
Verify messages exist in the channel
Verify app is added to the channel
Verify Slack app is enabled
Insufficient Permissions Error
Symptom: missing_scope
Resolution:
Add required scopes in Slack App settings:
Public channels:
channels:historychannels:read
Private channels:
groups:historygroups:read
Files:
files:read
Reinstall the app
Restart Fess
Cannot Crawl Files
Symptom: Files not retrieved even with file_crawl=true
Check:
Verify
files:readscope is grantedVerify files are actually posted in the channel
Verify file access permissions
API Rate Limiting
Symptom: rate_limited
Resolution:
Increase crawl interval
Reduce number of channels
Split into multiple data stores and distribute schedules
Slack API limits:
Tier 3 methods: 50+ requests/minute
Tier 4 methods: 100+ requests/minute
Large Number of Messages
Symptom: Crawl takes too long or times out
Resolution:
Split channels and configure multiple data stores
Distribute crawl schedules
Consider settings to exclude old messages
Advanced Script Examples
Message Filtering
Index only messages from a specific user:
if (message.user == "John Doe") {
title=message.user + " #" + message.channel
content=message.text
created=message.timestamp
url=message.permalink
}
Messages containing specific keywords only:
if (message.text.contains("important") || message.text.contains("incident")) {
title="[Important] " + message.user + " #" + message.channel
content=message.text
created=message.timestamp
url=message.permalink
}
Message Processing
Summarize long messages:
title=message.user + " #" + message.channel
content=message.text
digest=message.text.length() > 100 ? message.text.substring(0, 100) + "..." : message.text
created=message.timestamp
url=message.permalink
Format channel name:
title="[Slack: " + message.channel + "] " + message.user
content=message.text
created=message.timestamp
url=message.permalink
Reference Information
Data Store Connector Overview - Data Store Connector Overview
Atlassian Connector - Atlassian Connector
Data Store Crawling - Data Store Configuration Guide