Switch Between the Database and Elasticsearch Search Engines
On this page
FusionAuth searches Users and Entities with either the database search engine or the elasticsearch search engine. The elasticsearch search engine works with OpenSearch and Elasticsearch. You can switch engines at any time. For the differences between the engines, see Search Engines.
Every switch takes a restart, so plan for a short outage. For instructions on stopping and starting FusionAuth, see Start and Stop a Production Instance.
The steps on this page set configuration in fusionauth.properties or in environment variables. For every search setting, see the Configuration Reference.
Switch to the Elasticsearch Search Engine#
Before you start, install OpenSearch or Elasticsearch, and confirm that FusionAuth can reach the search engine. For instructions, see Install a Search Engine.
Check that each field in your data objects holds one data type across all objects. The Elasticsearch search engine skips objects with mismatched types when the engine indexes the objects. For more information, see Data Field Types.
-
Stop FusionAuth.
-
Set the search engine type and the search engine URL:
search.type=elasticsearch search.servers=http://localhost:9200SEARCH_TYPE=elasticsearch SEARCH_SERVERS=http://localhost:9200 -
Start FusionAuth.
-
In the Admin UI, navigate to System -> About . The Search row shows
OpenSearchorElasticsearch, and the version. -
Navigate to System -> Reindex , set Select an index to
User, typeREINDEXin Confirm, and click Save . When you use Entities, repeat withEntity. The new index is empty, so searches miss existing Users and Entities until the reindex finishes. A reindex takes longer with more Users and more custom data. For more information, see Reindex. -
Navigate to Users , and search for a User by email address. The Advanced search link appears below the search field.
Switch to the Database Search Engine#
-
Stop FusionAuth.
-
Set the search engine type to
database:search.type=databaseSEARCH_TYPE=databaseFusionAuth ignores
search.serverswith the database search engine, so you can leave the setting in place. -
Start FusionAuth.
-
In the Admin UI, navigate to System -> About . The Search row shows
Database. -
Navigate to Users , and search for a User by email address.
FusionAuth stops sending data to OpenSearch or Elasticsearch, and you can shut the search engine down. After the switch, requests with the query parameter return a 400 response, and FusionAuth doesn't support SCIM filters. For the full list of features that need the Elasticsearch search engine, see Search Engines.

Related
Learn how to install OpenSearch and connect FusionAuth to OpenSearch for advanced user and entity search.
Learn about the database and Elasticsearch search engines, which FusionAuth features use each engine, and how to choose one.
API documentation for the Rebuild the Elasticsearch Index API.
Learn how to search for users with queryString and query searches, page through large result sets, and build queries in the Admin UI.