×
Hacktoberfest is here! Contribute, collaborate & earn rewards.
  • Platform

    Platform

    • Overview
    • Channels
    • Playbooks
    • Integrations
    • Mobile
    • Security
    • Trust Center

    Interoperability

    • MS Teams
    • Atlassian
    • GitLab

    Flexible Deployment

    • On-Premise
    • Cloud
  • Solutions

    Use Cases

    • Purpose-Built Collaboration Hub
    • Self-Sovereign Collaboration
    • Mission-Critical ChatOps
    • Real-Time DevSecOps Collaboration
    • Integrated Security Operations
    • Out-of-Band Incident Response

    Industries

    • Critical Infrastructure
    • Defense
    • Technology
    • Global Public Sector
    • Financial Services
    • Energy and Utilities
    • Manufacturing
  • Customers

    Customers

    • USAF
    • Fujitsu
    • RTE
    • CERN
    • NRI
    • Pramacom
    • Crossover Health
    • Netfoundry
    See more customer stories »
  • Pricing
  • Partners

    Partners

    • Become a Partner
    • Partner Program
    • Deal Registration
  • Resources

    Resources

    • Resource Library
    • Blog
    • Demos
    • Events

    Documentation

    • Academy
    • Channels Guide
    • Playbooks Guide
    • Admin
    • Docs
    • API Reference
    • Release Notes

    Community

    • Join Community
    • Contribute
    • Deploy
    • Integrate
    • Download
  • Login

    Login

    • My Workspace
    • Admin Portal
    • Apps
    • Support
  • Contact Sales
Contents Menu Expand Light mode Dark mode Auto light/dark mode
Mattermost documentation
Mattermost documentation
  • Mattermost Overview
    • Editions and Offerings
    • Subscription Overview
      • Self-Hosted
      • Cloud
        • Cloud Dedicated
        • Cloud Shared
        • Cloud VPC Private Connectivity
      • Non-Profit
    • Certifications and Compliance Overview
    • Accessibility Compliance Policy
    • Releases and Life Cycle
      • Release Policy
      • Server
        • Server Releases
        • v10 Changelog
        • v9 Changelog
        • Unsupported Legacy Releases
        • Version Archive
      • Desktop
        • Desktop Releases
        • Desktop App Changelog
      • Mobile
        • Mobile Releases
        • Mobile Apps Changelog
      • Removed and Deprecated Features
    • Frequently Asked Questions
      • General
      • Community
      • Notifications
      • Video, Audio, and Screen Sharing
      • Enterprise
      • License
      • Mattermost Source Available License
      • Integrations
      • Use Cases
      • Product
      • High Trust
      • Design Decisions
      • Business
      • Illicit Use
  • Use Case Guide
    • Maximize Your Microsoft Investments
    • On-Premises Skype for Business Replacement
    • Secure Command and Control
    • DevSecOps Collaboration
    • Incident Response Collaboration
    • Out-of-Band Collaboration
  • Deployment Guide
    • Quick Start Evaluation
    • Application Architecture
    • Server Deployment
      • Preparations
        • Review software and hardware requirements
        • Set up an NGINX proxy
        • Configure Mattermost Calls
        • Set up TLS
        • Use an image proxy
      • Deploy with Kubernetes
      • Deploy with Linux
      • Deploy with Containers
      • Deploy for Out-of-Band Use
      • Deploy in Air-Gapped Environments
      • Reference Architecture
      • Scale for Enterprise
        • Backing storage benchmarks
        • Enterprise search
          • Elasticsearch setup
          • AWS OpenSearch setup
        • High availability
        • Redis
        • Scale up to 200 users
        • Scale up to 2000 users
        • Scale up to 15000 users
        • Scale up to 30000 users
        • Scale up to 50000 users
        • Scale up to 80000 users
        • Scale up to 90000 users
        • Scale up to 100000 users
        • Scale up to 200000 users
    • Desktop App Deployment
      • Install desktop app on Linux
      • Distribute a custom desktop app
      • Silent Windows desktop distribution
      • Desktop MSI installer and group policy guide
      • Desktop App custom dictionaries
      • Desktop managed resources
    • Mobile App Deployment
      • Deploy using an EMM provider
      • Distribute a custom mobile app
      • Host your own push proxy service
      • Mobile VPN options
      • Mobile security features
      • Secure file storage
      • Mobile apps FAQ
    • Deployment Troubleshooting
      • General deployment troubleshooting
      • Docker deployment troubleshooting
      • Desktop app troubleshooting
      • Mobile app troubleshooting
      • PostgreSQL installation troubleshooting
      • MySQL installation troubleshooting
  • Administration Guide
    • Self-hosted billing
    • Cloud workspace management
      • Workspace migration
      • Cloud data residency
      • Cloud IP Filtering
      • Cloud Bring Your Own Key (BYOK)
    • Server maintenance
      • Install a license key
      • Generate a support packet
      • Backup and disaster recovery
      • Upgrade Mattermost server
        • Important upgrade notes
        • Prepare to upgrade Mattermost
        • Communicate scheduled maintenance best practices
        • Upgrade Mattermost Server
        • Enterprise install and upgrade
        • Administrator onboarding tasks
        • Enterprise roll-out-checklist
        • Welcome email to end users
        • Downgrade Mattermost Server
        • Open source components
      • Secure Mattermost
        • Encryption options
        • Transport encryption
        • Multi-factor authentication
        • Delegated granular administration
        • Custom terms of service
        • User and group provisioning via AD/LDAP
        • SAML-based SSO
          • Okta SAML Configuration
          • Generate self-signed certificates
          • OneLogin SAML Configuration
          • Microsoft ADFS SAML Configuration for Windows Server 2012
          • Microsoft ADFS SAML Configuration for Windows Server 2016
          • Keycloak SAML Configuration
        • SAML SSO techical documentation
        • Certificate-based authentication
      • Mattermost error codes
      • Logging
      • mmctl
      • CLI
      • Feature labels
    • Server configuration
      • Store configuration in your database
      • Server configuration options
        • Self-hosted workspace edition and license settings
        • Cloud workspace subscription, billing, and account settings
        • Reporting configuration settings
        • User management configuration settings
        • Environment configuration settings
        • Site configuration settings
        • Authentication configuration settings
        • Plugins configuration settings
        • Integrations configuration settings
        • Compliance configuration settings
        • Experimental configuration settings
        • Deprecated configuration settings
        • Bleve search
      • Enable Copilot
      • Environment variables
      • Customize the server
        • Customize Mattermost
        • Custom branding tools
        • Code signing custom builds
      • SMTP email setup
      • Email templates
      • Chinese, Japanese, and Korean search
      • SSL client certificate setup
      • Connected workspaces
      • Telemetry
    • User provisioning
      • Corporate directory integrations
      • Provisioning workflows
      • AD/LDAP setup
      • AD/LDAP manage team or private channel membership
      • GitLab SSO
      • OpenID Connect SSO
      • Google SSO
      • Entra ID SSO
      • Convert OAuth 2.0 providers to OpenID
    • User management
      • Permissions
      • Manage team and channel configuration
      • Advanced permissions infrastructure
      • Guest accounts
    • Monitoring and performance
      • Optimize your Mattermost workspace
      • Collect performance metrics
      • Deploy Prometheus and Grafana for performance monitoring
      • Performance monitoring metrics
      • Push notification health targets
      • Performance alerting guide
      • Ensuring releases perform at scale
      • Manage user surveys
      • User satisfaction surveys
      • Notify admin
      • System-wide notifications
      • Statistics
      • In-product notices
      • Health checks
      • Health check probes
      • Product limits
    • Compliance
      • Compliance export
      • Compliance monitoring
      • Electronic discovery
      • Data retention
      • Export channel data
      • Legal Hold
      • JSON audit log schema
    • Migration
      • Migrate from MySQL to PostgreSQL
        • Automate PostgreSQL migration
        • Manually migrate to PostgreSQL
      • Server migration guide
      • Migrate from Slack
      • Bulk export tool
      • Bulk loading tool
      • Migration announcement email template
  • Security Guide
    • Zero Trust with Mattermost
    • Mobile Security
  • End User Guide
    • Connect and collaborate
      • Access your Mattermost workspace
        • Install the desktop app
        • Install the iOS mobile app
        • Install the Android mobile app
        • Log out of Mattermost
      • Organize using teams
        • Team settings
        • Team keyboard shortcuts
      • Organize using custom user groups
      • Invite people
      • Learn about Mattermost roles
      • Collaborate with audio and video
      • Collaborate within channels
        • Channel types
        • Channel naming conventions
        • Communicate a channel's focus and scope
        • Create channels
        • Rename channels
        • Convert public channels to private channels
        • Convert group messages to private channels
        • Join and leave channels
        • Make calls in Mattermost
        • Manage channel members
        • Browse channels
        • Navigate between channels
        • Mark channels as favorites
        • Manage channel bookmarks
        • Mark channels as unread
        • Archive and unarchive channels
      • Communicate with messages and threads
        • Send messages
        • Reply to messages
        • React with emojis and GIFs
        • Organize conversations
        • Mark messages as unread
        • Forward messages
        • Share links to channels and messages
        • Save and pin messages
        • Set message reminders
        • Search for messages
        • Schedule messages
        • Format messages
        • Set message priority
        • Mention people
        • Share files in messages
      • Collaborate within Microsoft Teams
      • Chat with Copilot
        • Copilot Context Management
      • Keyboard shortcuts
        • Keyboard accessibility
        • Run slash commands
        • Built-in-slash-commands
      • Extend Mattermost with integrations
    • Build repeatable processes
      • Learn about collaborative playbooks
      • Work with collaborative playbooks
      • Work with runs
      • Work with tasks
      • Work with notifications and updates
      • Work with metrics and goals
      • Share and collaborate
      • Interact with collaborative playbooks
    • Customize your preferences
      • Manage your notifications
        • Troubleshoot notifications
        • Manage your web notifications
        • Manage your desktop notifications
        • Manage your mobile notifications
        • Manage your thread reply notifications
        • Manage your @mention & keyword notifications
        • Manage your channel-specific notifications
      • Customize your Mattermost theme
      • Customize your channel sidebar
      • Manage your profile
      • Manage your security preferences
      • Set your status & availability
      • Manage your display options
      • Manage your sidebar options
      • Manage advanced options
      • Manage your plugin preferences
      • Customize your desktop app experience
      • Connect to multiple workspaces
  • Integrations Guide
    • Pre-built integrations
      • GitHub
      • GitLab
      • Jira
      • ServiceNow
      • Zoom
    • Microsoft integrations
      • Mattermost for M365, Teams, and Outlook
      • Playbooks in Microsoft Teams
      • Microsoft Calendar Sync
      • Microsoft Teams Sync
      • Join Microsoft Teams Meetings
  • Training and Support
    • Join our community
    • Community for Mattermost
    • Contribute to this documentation
Back to top
Edit this page

Enterprise search#

plans-img Available on Enterprise plans

deployment-img Cloud and self-hosted deployments

Mattermost database search starts to show performance degradation at around 2 million posts, on a server with 32 GB RAM and 4 CPUs. If you anticipate your Mattermost server reaching more than 2.5 million posts, we recommend enabling Elasticsearch or AWS OpenSearch Service for optimum search performance before reaching 3 million posts. Both tools are highly capable and can handle enterprise-scale workloads. The choice between them depends on the following factors:

  • Licensing and cost: AWS OpenSearch may be preferable for organizations avoiding proprietary licensing or opting for cost-effective solutions.

  • Feature requirements: Elasticsearch’s proprietary features (e.g., advanced analytics, security suites) may be preferred by organizations needing powerful out-of-the-box functionality.

  • Infrastructure alignment: AWS OpenSearch aligns well with AWS-centric environments, while Elasticsearch offers broader integrations.

Elasticsearch#

Elasticsearch is a well-established and widely used search engine with a large ecosystem and community support that provides enterprise-scale deployments with optimized search performance, dedicated indexing, and usage resourcing via cluster support for fast, predicable search results.

Mattermost’s implementation uses Elasticsearch as a distributed, RESTful search engine supporting highly efficient database searches in a cluster environment. Learn more about setting up and configuring Mattermost for an Elasticsearch server.

AWS OpenSearch Service#

AWS OpenSearch Service is the official path forward from Elasticsearch v7.10.x for AWS customers. It’s a fully managed service that makes it easy to deploy, operate, and scale OpenSearch clusters in the AWS Cloud to provide a simple and cost-effective way to search, analyze, and visualize data in real time.

The AWS OpenSearch Service is built on the open-source OpenSearch project, which is a community-driven fork of Elasticsearch. Learn more about setting up and configuring Mattermost for an OpenSearch server.

Supported paths#

Review the following support paths for enterprise search based on the version you’re using:

Elasticsearch v8 is supported from Mattermost v9.11. While Mattermost supports Elasticsearch v7.17+, we recommend upgrading your Elasticsearch v7 instance to v8.x. See the Elasticsearch upgrade documentation for upgrade details, and see the Elasticsearch setup documentation for details on configuring your Mattermost deployment to use Elasticsearch.

AWS OpenSearch Service is the official path forward from Elasticsearch v7.10.x for AWS customers to provide a simple and cost-effective way to search, analyze, and visual data in real time. It’s essentially a continuation of Elasticsearch v7.10.x but maintained as open source by AWS. It provides long-term support, active development, and compatibility with AWS clients, libraries, and managed services.

See the AWS Elasticsearch v7.10.x tab on this page for details on upgrading to AWS OpenSearch, and see the AWS OpenSearch setup documentation for details on configuring your Mattermost deployment to use AWS OpenSearch.

If you’re using Elasticsearch v7.10.x under AWS’s managed services, you can’t use newer Elasticsearch clients like the v8 client without changing backend infrastructure. If you’re using AWS Elasticsearch v7.10.x, you must upgrade to AWS OpenSearch for future compatibility.

The migration path from Elasticsearch v7.10.x to OpenSearch has been designed to be straightforward, minimizing effort:

  1. Disable “compatibility mode” in OpenSearch.

  2. Upgrade Mattermost server.

  3. Update the Mattermost ElasticsearchSettings.Backend configuration setting value from elasticsearch to `opensearch` manually or using mmctl. This value cannot be changed using the System Console. See the Mattermost search backend type configuration setting documentation for additional details.

  4. Restart the Mattermost server.

Frequently asked questions (FAQ)#

Do I need to use Elasticsearch or AWS OpenSearch?#

No. Enterprise search engines are designed for large Enterprise deployments to run highly efficient database searches in a cluster environment. The default Mattermost database search starts to show performance degradation at around 2.5 million posts, depending on the specifications for the database server. If you expect your Mattermost server to have more than 2.5 million posts, we recommend using Elasticsearch or AWS OpenSearch for optimum search performance.

Should I install Elasticsearch or OpenSearch on the same machine as Mattermost Server?#

No. We strongly recommend that you install Elasticsearch or AWS OpenSearch on a dedicated machine that’s separate from the Mattermost server.

What types of indexes are created?#

Mattermost creates three types of indexes: users, channels, and posts. Users and channels have one index each. Posts are aggregated by date, into multiple indexes.

Can I pause an search indexing job?#

Yes. From Mattermost v6.7, the search indexing job is resumable. Stopping a server while the search indexing job is running puts the job in pending status. The job resumes when the server restarts. System admins can cancel an indexing job through the System Console.

Can an index rollover policy be defined?#

The AggregatePostsAfterDays configuration setting defines a cutoff value. All posts preceding this value are reindexed and aggregated into new and bigger indexes. The default setting is 365 days.

Are there any new search features offered with Elasticsearch?#

The current implementation of Elasticsearch matches the search features currently available with database search. The Mattermost team is working on extending the Elasticsearch feature set with file name and content search, date filters, and operators and modifiers.

Are my files stored in Elasticsearch or OpenSearch?#

No, files and attachments are not stored.

How do I monitor system health of an Elasticsearch server?#

You can use this Prometheus exporter to monitor various metrics about Elasticsearch: justwatchcom/elasticsearch_exporter.

You can also refer to this article about Elasticsearch performance monitoring. It’s not written specifically for Prometheus, which Mattermost’s performance monitoring system uses, but has several tips and best practices.

What form of data is sent to Elasticsearch or OpenSearch?#

Mattermost communicates with Elasticsearch or OpenSearch through its REST API using JSON messages for indexing and querying entities.

How much data is sent to Elasticsearch or OpenSearch and when?#

Every time a message is published, a channel is created, or a user changes, (either because their properties change e.g.: change of the first name or because they join/leave a channel), the data associated with that event is sent to Elasticsearch or OpenSearch.

If search via Elasticsearch or OpenSearch is enabled, every search will generate a query. If autocompletion is enabled, every user or channel autocompletion associated with writing a message or user search will generate a query.

How do I know if a search job fails?#

Mattermost provides the status of each Elasticsearch or OpenSearch indexing job in System Console > Environment > Elasticsearch. Here you can see if the job succeeded or failed, including the details of the error.

Failures are returned in the server logs. The error log begins with the string Failed job and includes a job_id key/value pair. Search job failures are identified with worker name EnterpriseElasticsearchAggregator and EnterpriseElasticsearchIndexer. You can optionally create a script that programmatically queries for such failures and notifies the appropriate system.

My search indexes won’t complete, what should I do?#

If you have an search indexing job that’s paused, it’s likely your Elasticsearch or OpenSearch server has restarted. If you restart that server, you must also restart Mattermost to ensure jobs are completed. If restarting the Mattermost server does not resolve the issue, commercial customers can contact Mattermost Support for assistance.

Do I need to purge first then bulk index each time?#

Yes.

Required Permissions For Mattermost Service Account#

In “least privilege” environments you may need to further constrain the service account permissions to limit the access your Elasticsearch or AWS OpenSearch service account has.

The following JSON provides an example of a “least privilege” permission set that allows Mattermost to operate correctly with Elasticsearch or AWS OpenSearch:

{
  "cluster_permissions": [
    "cluster:monitor/*",
    "indices:admin/template/put",
    "indices:data/write/bulk"
  ],
  "index_permissions": [
    {
      "index_patterns": [
        "\<IndexPrefix\>*"
      ],
      "allowed_actions": [
        "indices:admin/get",
        "indices:admin/create",
        "indices:admin/delete",
        "indices:admin/mapping/put",
        "indices:admin/mappings/fields/get*",
        "indices:data/read*",
        "indices:data/write*"
      ]
    }
  ]
}

A simpler, more flexible, and resilient variant of the above would be:

{
  "cluster_permissions": [
    "cluster:monitor/*",
    "indices:admin/template/put",
    "indices:data/write/bulk"
  ],
  "index_permissions": [
    {
      "index_patterns": [
        "\<IndexPrefix\>*"
      ],
      "allowed_actions": [
        "indices:*"
      ]
    }
  ]
}

Tell us more!

Your feedback helps us improve the Mattermost product documentation.

How can we make this page more helpful?

0/186

Have a feature request? Share it here.

Having issues? Join our Community server.

×
Thank you!

We appreciate your feedback.

Did you find what you were looking for?

😀

Yes

😐

Mostly

🙁

No!

Next
Elasticsearch server setup
Previous
Backing storage benchmarks
Copyright © 2015-2025 Mattermost
Made with Sphinx and @pradyunsg's Furo
On this page
  • Enterprise search
    • Elasticsearch
    • AWS OpenSearch Service
    • Supported paths
    • Frequently asked questions (FAQ)
      • Do I need to use Elasticsearch or AWS OpenSearch?
      • Should I install Elasticsearch or OpenSearch on the same machine as Mattermost Server?
      • What types of indexes are created?
      • Can I pause an search indexing job?
      • Can an index rollover policy be defined?
      • Are there any new search features offered with Elasticsearch?
      • Are my files stored in Elasticsearch or OpenSearch?
      • How do I monitor system health of an Elasticsearch server?
      • What form of data is sent to Elasticsearch or OpenSearch?
      • How much data is sent to Elasticsearch or OpenSearch and when?
      • How do I know if a search job fails?
      • My search indexes won’t complete, what should I do?
      • Do I need to purge first then bulk index each time?
    • Required Permissions For Mattermost Service Account