Search: the database engine and Solr
This page is for developers who choose and run the search engine of a DXP project. The DXP ships the database search
engine (named legacy in the configuration) and the Solr engine (ibexa/solr). Your code uses the same search API
with either.
Contents
Choosing an engine
| Engine | Setting | Good for |
|---|---|---|
| Database (default) | SEARCH_ENGINE=legacy | Small and medium sites, development, no extra service |
| Solr 8 (8.11.x recommended) | SEARCH_ENGINE=solr | Large content sets, relevance ranking, facets, heavy full-text use |
The name legacy means "the search engine that queries the database"; it has nothing to do with the Exponential 6
kernel.
Switching to Solr
From the skeleton's guide (section 18):
Set
SEARCH_ENGINE=solr,SOLR_DSNandSOLR_COREin.env.local.php bin/console cache:clear.Create the core with Solr's own HTTP API ("no console command exists in v5"):
curl "http://localhost:8983/solr/admin/cores?action=CREATE&name=default&configSet=exponential"The config set named in the request must exist on your Solr server.
Index everything:
php bin/console exponential:reindex(Reindexing).
Switching back
SEARCH_ENGINE=legacy
php bin/console cache:clearSearching from code and templates
In PHP, inject Ibexa\Contracts\Core\Repository\SearchService and run a query with criteria and sort clauses; the
same query runs on both engines. For lists in templates, the content query field type runs a query as a field
(The field types it ships).
Limits to know
- On SQLite there is no FULLTEXT index; full-text search falls back to
LIKEqueries (SQLite for development). - Changing a content type's searchable fields needs a reindex.
- With Solr, plan for the Solr server like any other service: monitoring, backups of its configuration, and a reindex after restoring it.
Related pages
- Reindexing
- Environment variables
- Searching in Exponential 6
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.