Mattermost enterprise search: when you need Elasticsearch or OpenSearch

Database search in Mattermost works until message volume, user counts or search demand outgrow it. This page explains the signals to measure and how to choose between Elasticsearch and OpenSearch.

On this page

When Mattermost enterprise search outgrows the database

A dedicated search service becomes worth considering when your self-hosted Mattermost search slows down or when the deployment has grown past what one server handles comfortably. The choice at that point is between Elasticsearch and OpenSearch, and the decision rests on licensing, the features you need and how well each fits your infrastructure. Mattermost's high availability documentation describes search replicas as part of a scaled deployment, and the Mattermost high availability cluster-based deployment docs and the sibling sizing guide govern the exact setup, including which search versions your server release supports. Check those versions before you select a product, because the supported list changes with Mattermost releases.

The supplied facts do not include a post-count threshold at which database search stops being enough, so do not adopt a number from a blog post or forum thread as your trigger. Instead, measure your own system for a few weeks. Record how long search queries take for typical users, how often they time out or return slowly, how fast your post and file tables grow, and whether database load rises during search peaks. Ask Mattermost which search behavior to expect at your user count and which configuration it recommends for your plan. Those measurements, not a published figure, are what justify the added search service and its operating cost.

Once the measurements show a real need, write the decision down before you install anything. Confirm the Mattermost release you run and its support window, confirm the Elasticsearch or OpenSearch versions that release supports, and confirm which license terms your legal and procurement teams accept for the search tier. Also note who will patch and back up the search nodes, because an unmaintained search index is a separate failure point. If you cannot answer these questions from your own environment and the vendor documentation, that gap is the first item to resolve.

How search requests move through a Mattermost deployment

The diagram starts at the user's client, which sends a search through the load balancer to a Mattermost application node. Database search runs against the PostgreSQL primary or its read replicas, and the application node routes reads to replicas while writes always go to the primary. The dedicated search backend sits inside a marked trust boundary and is a separate component from the search replicas, so check which path your team has configured and how the search engine is secured, authenticated and kept in step with new posts.

Search reads and writes travel different paths through the Mattermost deployment.

Elasticsearch or OpenSearch: how the options compare

This table compares Elasticsearch and OpenSearch for Mattermost search on license terms, paid editions, version lineage, release cadence, security features, installation methods and infrastructure fit. Read the Elasticsearch rows as items to verify with Elastic and the Mattermost docs, since those terms are not covered by the facts here. The main takeaway is that OpenSearch's licensing and feature set are documented, while Elasticsearch fit must be confirmed against current terms.

CriterionOpenSearchElasticsearch
License termsAll OpenSearch project software is released under the Apache License, Version 2.0Confirm current license options and terms directly with Elastic before deciding
Paid editionsThe OpenSearch FAQ does not describe any paid editionConfirm which features sit in paid tiers with Elastic
Version lineageFork of open source Elasticsearch 7.10, wire-compatible with 7.10Ask Elastic and Mattermost which Elasticsearch major versions the current Mattermost release supports
Release cadenceNew minor version about every eight weeks; 3.9.0 released September 29, 2026Confirm release and support schedule with Elastic
Authentication backendsSAML, OpenID Connect, Active Directory, LDAP, Kerberos and JSON Web TokenConfirm supported authentication and security features for your edition
Security featuresRole-based access control, document and field-level security, field masking, audit logs, TLSConfirm which of these controls your license tier includes
Installation methodsDocker, Helm, Kubernetes Operator, tarball, RPM, Debian, Ansible, WindowsConfirm supported installation methods in Elastic documentation
Infrastructure fit (managed, on-premises, air-gapped, Kubernetes)Check each deployment model against OpenSearch install docs and your cloud provider's managed service optionsCheck managed, on-premises, air-gapped and Kubernetes support with Elastic and your Mattermost version notes

What OpenSearch's Apache 2.0 license settles for procurement

All software in the OpenSearch project is released under the Apache License, Version 2.0, and the OpenSearch FAQ does not describe any paid edition. For procurement, that means the engine itself does not appear as a license line item. Your purchase order for an OpenSearch-based search tier will carry infrastructure, operations and any support you buy, but not a per-node or per-seat fee for the software. The OpenSearch FAQ is the place to confirm that position before you cite it internally.

The license does not settle the cost of running the cluster. Dedicated search hosts, storage for indexed posts, snapshot storage, monitoring and the engineering time to upgrade and patch the cluster all recur. The license also does not cover a managed service such as Amazon OpenSearch Service, where the provider's pricing applies, and it does not cover any support contract you negotiate. Ask each vendor for those terms in writing and keep them separate from the software line.

The license also says nothing about the licensing of other components in the same stack. Mattermost licenses its compiled binaries under MIT, its custom-build source under AGPL v3.0 with a commercial alternative from Mattermost, Inc., and its admin tools under Apache 2.0, so check the Mattermost terms that apply to your plan and build. If the team also considers Elasticsearch, do not assume it shares OpenSearch's terms. Get written confirmation of the Elasticsearch license terms for the exact version you plan to run, and have your legal or procurement team review them before you compare the two options on cost.

Signals that database search has stopped being enough

Database search in Mattermost is a reasonable default until its cost shows up in user complaints, database load and growth in data. The signals below connect those symptoms to measurements you can take on your own server, so the decision to add Elasticsearch or OpenSearch rests on your baselines rather than a generic threshold. No fixed post count is published in the supplied facts, so set thresholds from your own data and confirm sizing guidance with Mattermost before you buy.

Slow or timed-out searches

Start with the people who use search most. Collect reports of searches that return slowly or fail, and note the time of day, channel size and query shape involved. Then check the Mattermost server logs for slow or errored search requests during those windows, and compare them with a quiet period. Recurring timeouts on normal queries, not just unusual wildcard searches, are the first sign that database search is no longer keeping up.

HA cluster docs

Search competing with message writes

Check whether search queries slow down posting and reading on the same PostgreSQL primary. Compare database CPU, active connections, lock waits and query duration for search statements against write statements during peak hours. If chat writes lag while people search, search is consuming capacity the core chat needs. This is the strongest argument for moving search off the database, because it affects everyone, not only searchers.

Message and attachment growth

Track monthly message counts and attachment volume over at least several months, using the database and your file store. A steady climb in posts per user, or a jump after a team joins or a new integration starts posting, changes the search workload faster than headcount alone suggests. Project the trend forward and compare it with your current database headroom. Growth that will outpace your next capacity review is a reason to plan the search tier now.

Many concurrent searchers

Measure peak concurrent users who run searches at the same time, not total licensed seats. Sessions that overlap during incident response, all-hands planning or shift changes can produce search bursts that a single database handles poorly. Ask Mattermost which sizing reference matches your concurrency and what search node layout it assumes. Use your own peak measurements as the input, and confirm the numbers in writing before you commit to hardware.

Deployment planning docs

Search across a long retention window

Identify how far back people must search for business, legal or compliance reasons, and compare that window with your retention settings. Users who need to find messages from years ago put the heaviest load on search, because the query scans the most data. Confirm with your records and compliance owners which period must stay searchable, then test a query across that full range on a staging copy. A long required window is a strong signal to design search capacity around it.

A plan to isolate search

Decide whether you intend to separate search from core chat, through a dedicated search node, a search replica or an external search service. If that plan already exists, the question becomes which engine fits your licensing, features and operations, and when to cut over. Write down the trigger, owner and rollback steps before the migration. Any high availability work your plan depends on, including the shared file storage requirement, should be confirmed against the Mattermost documentation first.

Choosing an engine by hosting environment

On virtual machines or bare metal you control, the search engine is a service you install, patch and place yourself. OpenSearch is distributed as a tarball, RPM, Debian package, Docker image, Helm chart, Kubernetes operator and Ansible playbook, so the install method should match how your team already builds and patches hosts. The OpenSearch install documentation lists these options.

  • Installation: choose a package format your configuration management already controls, and keep search nodes separate from Mattermost application nodes.
  • Patching: maintenance versions receive security patches but no new features, so schedule search cluster patching as its own change, separate from Mattermost server upgrades.
  • Network placement: allow only the Mattermost application nodes to reach the search API, and keep node-to-node traffic on an internal segment.
  • TLS and authentication: enable TLS for node and client traffic, and connect Mattermost with a service account whose permissions the OpenSearch Security plugin scopes.

Confirm the OpenSearch version you plan to run against the version Mattermost documents for your server release before you choose a package.

How to choose and set up search in order

This sequence takes a Mattermost team from measuring today's search and database load to a verified search engine that is ready for cutover, with each decision checked before the next one starts.

  1. Measure current search and database load

    Record how search performs today: how many posts the server holds, how long common searches take, and how busy the PostgreSQL primary is during peak hours. Note which users complain about slow results and whether the slowness comes from search queries or from unrelated database load. Ask the team to confirm the post counts and query timings in writing before anything else is decided. The step is done when you have a baseline document that you can compare against after cutover.

  2. Confirm the Mattermost release and plan

    Identify the server version you run or plan to run, and whether it is a monthly release or an Extended Support Release, using the Mattermost release page. Confirm your plan, because high availability clustering is documented only for Enterprise and Enterprise Advanced, and the search configuration you choose should fit that topology. Check the support end date for the version so the search engine upgrade path does not fall after it. The step is done when the release, plan and support window are written down and approved by the owner of the Mattermost contract.

  3. Confirm the required search engine version

    Read the Mattermost documentation for your exact server release and record the Elasticsearch or OpenSearch versions it supports. Do not assume that a newer engine release works. Ask your Mattermost account contact or check the documentation for any version requirement that applies to your release. The step is done when you have a single supported engine version range recorded against the server version, which will drive the build in later steps.

  4. Choose the engine on license, features and fit

    Compare Elasticsearch and OpenSearch on the points that matter to you: license terms that your legal team has reviewed, features you need from the security layer, the versions your Mattermost release supports, and who will operate the cluster. OpenSearch is released under Apache License 2.0 and documents a security plugin with role-based access control, audit logs and TLS. Confirm current Elasticsearch license terms directly with the vendor. The step is done when a decision record names the engine, the version and the reasons, and your security and procurement leads have signed it.

  5. Deploy the search cluster in a dedicated zone

    Build the search cluster in its own network segment, separate from the application and database tiers, with access allowed only from the Mattermost servers that need it. Enable TLS for node and client traffic and turn on authentication with dedicated service credentials for Mattermost. Store those credentials in your secrets manager rather than in shared configuration files. The step is done when a connectivity test from the Mattermost test server succeeds, and a test from any other subnet is refused.

  6. Connect and index in a test environment

    Point a non-production Mattermost server at the new search cluster and configure the search settings in the System Console. Index a copy of production posts so that the test data matches real volume. Watch indexing progress and cluster health, and record any errors in the Mattermost and search logs. The step is done when indexing completes without errors, the cluster reports a healthy status, and the test server returns results for a known set of search terms.

  7. Verify results, latency and access controls

    Run the search test set you recorded in the first step and compare result accuracy and response times with the baseline. Confirm that a user who cannot see a channel gets no results from it, and that deleted or archived content behaves as your retention policy requires. Check that search does not add pressure to the primary database during peak load. Ask the security team to test access controls from a standard user account. The step is done when results match expectations, latency meets the target your team agreed on, and access tests pass with the findings documented.

  8. Cut over with a documented rollback

    Schedule the production change in a window agreed with the business, and index production posts following the procedure you tested. Keep the previous search setting available so you can revert if results or latency regress. After cutover, repeat the baseline checks and monitor the cluster and Mattermost logs. The step is done when production search returns expected results, the rollback path has been confirmed, and the change record is closed with the measured results attached.

Security and operations to plan for the search service

A search index holds copies of message content, so it carries the same sensitivity as the database it mirrors. The cards below separate what the engine provides from what your team must configure, test and keep current over the life of the service.

Retention and deletion of indexed posts

The index holds copies of messages, so when a post is deleted or expires under your Mattermost retention policy, the copy in the search index must follow. Confirm how deletions and retention purges reach the index in your Mattermost version, and test that a deleted message no longer returns in search. Plan the index lifecycle so that backups of the index are subject to the same retention rules as the database.

Authentication to the search cluster

Every person and service that talks to the index needs an identity, and the cluster should not accept anonymous connections. The OpenSearch Security plugin supports SAML, OpenID Connect, Active Directory and LDAP, Kerberos and JSON Web Token backends, so choose the one that matches your directory. Confirm which backend fits the Mattermost connection and keep the Mattermost service account separate from administrator accounts.

OpenSearch security docs

Role-based and field-level access

The Security plugin provides role-based access control, document-level and field-level security, field masking and user impersonation. Use these to limit which roles can query, export or administer indices, and to mask fields that should not be visible to operators. Confirm in testing that Mattermost's service account has only the index permissions it needs, and that operator roles cannot read message content they are not cleared to see.

Audit logging and evidence

Audit logs record who queried, changed or administered the cluster, which gives your security team evidence for investigations and assessments. The engine provides audit logging, but you must decide where logs go, how long they are kept and who reviews them. Confirm that audit records cover the Mattermost service account and administrator actions, and that they are shipped to storage outside the search cluster.

TLS and network isolation

Enable TLS for node-to-node and client traffic so message content does not cross the network in clear text. Place the search nodes on a private network segment that users cannot reach directly, and allow only the Mattermost servers and approved administrative hosts to connect. Confirm certificate issuance, rotation and trust configuration on the Mattermost side, since a mismatch is a common cause of failed connections.

Patching on the engine's schedule

OpenSearch keeps each version in maintenance until the next major version enters maintenance or one year passes, whichever is longer, and maintained versions receive bug fixes and security patches. Plan upgrades on that cadence and separately from Mattermost monthly releases, and confirm which OpenSearch versions your Mattermost release supports before each upgrade. Test every upgrade in a non-production cluster first, since the engine and the Mattermost connector each change.

OpenSearch releases

Limits to confirm before you commit

Before you choose an engine, resolve five open questions with Mattermost and with the engine vendor. The first is which Elasticsearch or OpenSearch versions the Mattermost release you run supports. The supplied facts do not give that compatibility matrix, so confirm it in the Mattermost search documentation for your exact server version, and do not assume that a version that works for another product works for Mattermost. The second is how existing posts are indexed and how long that takes on your data. Confirm the bulk indexing procedure, whether it can run while users are active, and what throughput to expect at your post volume. Ask Mattermost for an estimate based on a copy of your database, not on a generic figure.

The third question is commercial. Confirm whether search engine support is covered by your Mattermost plan and support terms, and whether the engine itself is supported by Mattermost, by the engine vendor, or by neither. Ask who answers a production ticket that involves the engine. The fourth is failure behavior. Confirm what users see when the search service is unreachable, whether search queries fail or fall back to database search, whether new posts are still written and indexed later, and how the backlog is repaired. Test this in a pilot rather than relying on the answer alone.

The fifth is upgrade sequencing. Confirm the order in which the engine and Mattermost must be upgraded, whether a Mattermost release can be paired with more than one engine minor version, and how the index format changes between versions. Write the answers into your change plan and your runbook before you commit to a design, because each answer changes the pilot you need to run.

Questions buyers ask about Mattermost search

What drives the cost and effort of a Mattermost search deployment?

The main drivers are how many posts and files you need to index, how many users search at once, whether you run the engine on dedicated hosts, and how much of the work is new to your team. One-time costs include the design, the engine installation, the connection to the Mattermost System Console, and the initial indexing of existing posts. Recurring costs include the servers or cloud capacity, engine upgrades, monitoring and the operating time your staff spends on it. Ask a partner to price these as separate line items so you can see which ones recur. Mattermost sells its own plans as prepaid annual subscriptions based on seat licenses, and its pricing page lists no public prices, so confirm with Mattermost what search capability your plan includes before you scope the engine work.

How long does a Mattermost search rollout take, and what sets the duration?

The duration depends on the size of your existing message history, the number of search nodes you need, the state of your current Mattermost deployment, and how many environments must be built and tested before production. Indexing existing posts is often the longest step because it runs against your real data volume, so the size of your history is the single biggest variable. Change windows also matter, since search changes touch the Mattermost configuration and may need a maintenance period. Ask for a written schedule with a named test environment, a load or indexing test before cutover, and a rollback step. Any figure a vendor gives should be checked against your own data volume in a pilot.

What does the work need from our team?

Expect to provide network access between the Mattermost application servers and the search nodes, a decision on identity for administrative access to the engine, dedicated storage sized for the index, and a named owner for each system. The network path must allow traffic on the ports the engine uses, and firewall rules must be agreed with your security team before build starts. Storage and backup capacity need to be assigned early, since indexes grow with message volume. Your team also needs to agree on change windows for the Mattermost server and the search engine, because both are upgraded on their own release cycles. Ask the partner to list these dependencies in the scope document with an owner for each.

Can our own team deploy Mattermost search without outside help?

Yes, if your team has Linux administration, search engine operations and Mattermost administration skills and time to test the result. The Mattermost documentation covers connecting the engine and indexing existing posts, and the engine itself can be installed through several supported methods. The risk lies in the tuning, the upgrade path and the day-two work, which are easy to underestimate. A partner is useful when you lack one of those skills, need a fixed-scope delivery with written deliverables, or want an independent check before go-live. Decide based on who will run the system after launch, because the operating load usually exceeds the installation effort.

Does running a search engine add a license cost?

OpenSearch is released under the Apache License, Version 2.0, and the OpenSearch FAQ does not describe any paid edition, so the engine software itself carries no license fee. Your costs are the infrastructure, the operating time and any support contract you choose. Elasticsearch is a different case, and its license terms have changed over time, so confirm the current terms and the edition that applies to your use with Elastic before you commit to a design. Also confirm which Mattermost plan you hold and whether it includes the search capability you plan to use, since the Mattermost pricing page groups features by plan.

What should we ask for in a written quote for search work?

Ask for a scope that names the engine and version, the Mattermost version and plan, the number of search nodes and hosts, the indexing approach for existing posts, and the environments included. Request a list of deliverables such as the configuration record, the runbook, the test results and the handover session. Ask how the quote handles Mattermost version changes, engine upgrades during the project, and any work outside the scope. Confirm what the client must provide and by when, and what happens if those inputs are late. Require the quote to separate one-time work from recurring support so you can compare options with your internal costs.

Which engine should we choose, Elasticsearch or OpenSearch, for Mattermost?

Choose based on the engine versions Mattermost supports for your release, the license terms you accept, the infrastructure you already run, and your team's skills. OpenSearch is Apache 2.0 licensed and maintained by the OpenSearch Software Foundation, which is a Linux Foundation project. Confirm the exact engine versions your Mattermost release supports in the Mattermost documentation before you decide, since support can change between releases.

How DeployOpen scopes and delivers Mattermost search

DeployOpen approaches Mattermost enterprise search as a written, fixed-scope decision. We confirm your post volume, Mattermost plan and existing infrastructure first, then build and hand over the search layer you choose, with its security controls and runbooks documented for your own team.

How we scope

  • Confirm your Mattermost server version, plan level and current search settings before choosing a search engine
  • Measure post volume, growth and search query patterns against the thresholds in this guide
  • Agree in writing whether Elasticsearch or OpenSearch fits your licensing and infrastructure constraints
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts

How we build

  • Provision the search cluster in infrastructure you control, with TLS and access restricted to Mattermost nodes
  • Configure the connection from the Mattermost System Console and validate indexing of existing posts
  • Test search results, permissions and performance under load before the cutover
  • Confirm that the search tier behaves correctly within your high availability design

How we hand over

  • Document the architecture, version choices, configuration values and access model for your team
  • Provide runbooks for index maintenance, upgrades, backups and troubleshooting search problems
  • Walk your administrators through monitoring of the search cluster and the Mattermost connection
  • Record open items and the upgrade path tied to Mattermost monthly releases and ESR timelines

How we support

  • Offer ongoing support, upgrades and continuous testing as a retainer after handover
  • Plan search cluster upgrades alongside each Mattermost server upgrade you schedule
  • Retest search behavior after version changes, plan changes or infrastructure moves
  • Confirm the support scope, response expectations and fees in the written quote before work begins

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.