Bleve Search (Experimental)¶
Bleve is a search engine that uses Lucene-style full-text search and indexing. This style of search and indexing helps overcome limitations of the default database search such as challenges with characters and advanced search capabilities.
The Bleve search engine works as a library integrated into the Mattermost codebase. As it generates indexes in the filesystem of the server that it is running on, it doesn’t require an external server to function. Because of this, Bleve should not be enabled in High Availability deployments.
Configuring Bleve in Mattermost¶
Follow these steps to configure the Mattermost server to use Bleve and generate required indexes. Once the configuration is saved, new posts made to the database will be automatically indexed with Bleve.
Note: During indexing, search results may be incomplete until the indexing job is complete.
Open System Console > Experimental > Bleve.
Set Enable Bleve Indexing to true to enable the other settings on the page.
Set the directory path to use for storing bleve indexes (e.g.:
/var/opt/mattermost/bleveindexes). The user running Mattermost should have permissions to access the directory. See our Configuration Settings documentation for details.
Save the configuration.
Select Index Now. All users, channels, and posts in the database will be indexed oldest to newest.
Set Enable Bleve for search queries to true.
Set Enable Bleve for autocomplete queries to true.
Search results for files shared before upgrading to Mattermost Server v5.35 may be incomplete until an extraction command is executed using the CLI. After running this command, the search index must be rebuilt. Go to System Console > Experimental > Bleve > Bulk Indexing, then select Index Now to rebuild the search index to include older file contents.
Using Bleve Search¶
The following conditions are applied when using Bleve search:
Unquoted terms: Search terms that contain non-alphanumeric characters/special characters outside of quotation marks are removed. For example, using
abcd "**" && abcas a search term will return results for a search for
abcd "**" abcas the
&&characters weren’t within the quotation marks.
Wildcard search: Wildcard search (e.g.,
abc*) is supported.