Search with ezfind and Solr
This page is for website creators whose site outgrows the built-in search. The ezfind extension connects Exponential
to an Apache Solr server; Solr is optional and nothing changes until you switch it on
(exp:solr).
Contents
When Solr is worth it
| Need | Built-in engine | Solr |
|---|---|---|
| Find pages by words | yes | yes |
| Relevance ranking and boosting | basic | yes |
| Facets (filter results by class, tag, date) | no | yes |
| Very large numbers of objects | slows down | built for it |
Tag clouds from search (eztags TagCloudOverSolr) | no | yes |
Solr is a separate server (Java) to install, run, monitor and back up. For a small site the built-in engine is fine.
The parts
| Part | What |
|---|---|
extension/ezfind | the extension: ezfind.ini, solr.ini, and site.ini.append.php with SearchEngine=ezsolr |
settings/solr.ini [SolrSettings] | the kernel's Solr control: Enabled, Url, BinaryPath, Host, Port, DataDir |
exp:solr | the console command: status, start, stop, restart, ping |
Switching it on
- Install a Solr server (locally with
BinaryPath, or a remote one withUrl). - Set
[SolrSettings] Enabled=trueand the address insettings/override/solr.ini.append.php. - Check:
./console exp:solr status --allow-root-user, thenping. - Activate
ezfind; itssite.ini.append.phpswitches[SearchSettings] SearchEnginetoezsolr. - Clear the INI cache and build the index (below).
Indexing
php bin/php/updatesearchindex.php --clean --allow-root-userWith delayed indexing, moves and visibility changes queue index_moved_node actions for Solr, because Solr keeps paths
(10.8 Search). Keep the indexing cron
part running.
What changes for templates
content/search keeps working; results come from Solr. Facets and filters are available through ezfind's fetch
functions and its own search templates; read the extension's documentation in extension/ezfind/ for the exact names in
your version before writing facet templates. The online editor's search dialogs also use Solr when it is active
(4. The online editor).
Related pages
- Site search
- Server control commands
- Scaling applications
- 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.