SOLVED What is the advantage of using ElasticSearch as the search engine?
What is the advantage of using ES over the database as the search engine?
From the docs we can choose either, but I am interested to know what I would be missing if I were to use DB as the search engine instead of Elastic.
TL:DR, Elasticsearch is much more powerful than DB. But if you only have a couple thousand users and don’t need to perform sophisticated queries, the upside is that you don’t need to run Elasticsearch as a separate component.
The DB search doesn’t provide the full search query capabilities that ES does. It also won’t scale to millions of users nearly as well as ES does.
This doc has some information on the differences: https://fusionauth.io/docs/v1/tech/apis/users#search-for-users
Some higher level details here as well : https://fusionauth.io/docs/v1/tech/core-concepts/users#user-search
You can always change your mind as well. If you start with db for ease of development, setup and maintenance, you can then later switch to elastic, and perform a reindex operation to initialize the elasticsearch index.
Or vice versa. It just requires a config change, a restart and then an index operation to move to Elasticsearch.
Here's a doc about how to switch search engines: https://fusionauth.io/docs/v1/tech/tutorials/switch-search-engines