Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Search engine integration

How site search is wired in Exponential and how to connect an external search service - the built-in engine, the ezpSearchEngine plugin interface, Solr through ezfind and exp:solr, delayed indexing, reindexing after…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/integrators/search-engine-integration.md

On this page

Search engine integration

This page is for integrators who must improve or replace the site search, or feed content into a search service the customer already runs. Search in Exponential is a pluggable engine: the kernel calls eZSearch, which hands every add, remove and query to the engine named in site.ini [SearchSettings] SearchEngine.

Contents

  1. The parts
  2. Option A: the built-in engine
  3. Option B: Solr through ezfind
  4. Option C: a search engine plugin of your own
  5. Option D: an external index next to the site search
  6. Indexing after imports
  7. Search over the APIs

The parts

PartWhere
The engine settingsite.ini [SearchSettings] SearchEngine=eZSearchEngine
The interface every engine implementsezpSearchEngine (kernel/private/interfaces/ezpsearchengine.php): addObject(), removeObject(), removeObjectById(), search(), supportedSearchTypes(), needCommit(), needRemoveWithUpdate(), commit()
Where engines are looked forkernel/search/plugins/<name>/<name>.php, then extension/<ext>/search/plugins/<name>/<name>.php for each extension in [SearchSettings] ExtensionDirectories[] (eZSearch::getEngine())
Delayed indexing[SearchSettings] DelayedIndexing (disabled, enabled or classbased with DelayedIndexingClassList[]); the global cronjob script indexcontent.php indexes what was queued
Full reindexphp bin/php/updatesearchindex.php (--clean empties the index first)

Option A: the built-in engine

eZSearchEngine indexes words in database tables. It needs nothing else to run and is enough for small and medium sites. Statistics of search phrases are off by default (LogSearchStats=disabled), because they can hold personal data.

Option B: Solr through ezfind

The ezfind extension connects the site search to Apache Solr (facets, relevance tuning, the content of files). It is not in the require list of the root composer.json; install it separately and check its state before you promise it. The kernel's exp:solr command controls a Solr server once solr.ini [SolrSettings] Enabled=true:

php bin/php/console exp:solr status --allow-root-user
php bin/php/console exp:solr ping --allow-root-user

Read Search with ezfind and Solr and Server control commands.

Option C: a search engine plugin of your own

To make the site search use another service (OpenSearch, Elasticsearch, a SaaS search), write a class that implements ezpSearchEngine in your extension:

extension/myintegration/search/plugins/myintegrationsearch/myintegrationsearch.php   class myIntegrationSearch
# settings/override/site.ini.append.php
[SearchSettings]
SearchEngine=myIntegrationSearch
ExtensionDirectories[]=myintegration

The directory and file name are the engine name in lower case; the class name is the setting's value. Everything that calls the search (the search page, fetch( 'content', 'search', ... ), the expsearch services) then uses your engine, and every publish and remove calls addObject() and removeObject(). This is the deepest integration and the largest piece of work: the search page templates expect the result structure of the built-in engine.

Often the customer's enterprise search only needs to receive content, while the site keeps its own search. Then do not replace the engine: send publications to the external index with an outbox (Workflows and triggers as hooks), removals with the audit webhook or the same outbox, and let a cronjob part deliver them. A full reload is a server-side export (Writing an export).

Indexing after imports

SituationDo
An import created objects through eZContentFunctionsNothing: publishing indexes them (or queues them with delayed indexing)
Delayed indexing is onMake sure the global cronjob part runs (indexcontent.php)
A package was installed with ezpm.phpThe installer delays indexing: run php bin/php/updatesearchindex.php
Data was changed outside the publish operationRun php bin/php/updatesearchindex.php; better, do not change data that way

Search over the APIs

The REST API has no search route. expservices has expsearch::search, count, facets, byClass, inSubtree, bySection, byAttribute, suggest and engine (which engine is in use), each checked against content/read (Remote services with expservices).

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.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x