Plug any search engine into your Bagisto store without touching the search code. Bagisto Search Engines puts every engine behind one contract and one manager.

The Bagisto 2.5 release specifically rebuilt product search around two patterns: Strategy and Manager.
First, look at the old design. In Bagisto 2.4 the product repository held the engine name as a string and checked it everywhere:
|
1 2 3 4 |
// Bagisto 2.4: each method checked the engine name itself. if ($this->searchEngine == 'elastic') { return $this->elasticSearchRepository->getSuggestions($query); } |
An engine implements four methods: search, suggestions, slug lookup and maximum price. Therefore, the repository calls only those.
Similarly, indexing has its own contract, SearchIndexer: index a batch, delete a batch, and reindex everything.
Instead of naming a class, callers now ask the manager for the engine of the current context:
|
1 2 3 4 |
// Bagisto Search Engines: ask the manager, never name the engine. return $this->searchEngineManager ->engine($this->searchContext) ->getSuggestions($query); |
To decide, the manager reads a master switch, a default engine, and one search mode for each side of the store:
|
1 2 3 4 5 |
$modeKey = $context === SearchContextEnum::ADMIN ? self::ADMIN_MODE_KEY : self::STOREFRONT_MODE_KEY; return $this->toEngine(core()->getConfigData($modeKey), $master); |
As a result, a mode left on Use Default takes the default engine. With the switch off, every search runs on the database, and indexing gets a null indexer.
In addition, an engine that needs a server binds a SearchEngineConnection: configure, probe, and compare with the saved settings.
Then, Test Connection probes the values on screen. If it fails, the result names its cause: unreachable, unauthorized, incompatible or misconfigured.
Moreover, the verdict is cached for five minutes, and only when it matches the saved settings, so unsaved tests never change it.

For example, take Algolia. The same steps also fit Typesense, Meilisearch or OpenSearch.
Next, give the engine its name, and then register its classes:
|
1 2 |
// SearchEngineEnum: one case names the new engine. case ALGOLIA = 'algolia'; |
|
1 2 3 |
$this->app->singleton('product.search.engine.algolia', AlgoliaSearchEngine::class); $this->app->singleton('product.search.indexer.algolia', AlgoliaSearchIndexer::class); $this->app->singleton('product.search.connection.algolia', AlgoliaConnection::class); |
After that, Bagisto Search Engines lists it in the admin dropdowns, the manager resolves it, and its settings apply on boot.
The screens below show an example Algolia engine. In contrast, Bagisto core ships with the database and Elasticsearch engines.

Likewise, its settings page follows the same layout as Elasticsearch, with the fields your connection class reads and the same Test Connection button.

However, the enum lives in Bagisto core, so a new name goes in as a core change or pull request. Swapping an engine needs none.
For example, an OpenSearch package can bind its own class to the Elasticsearch alias, and every search in the store follows it.
Finally, build the engine faster with Bagisto Agent Skills. They teach your AI assistant the package structure, bindings, config and tests.
So when you ask it to scaffold the Algolia engine package, it follows Bagisto’s conventions instead of guessing them.
Works with Bagisto extensions:
A new engine name does, because the list of engines is an enum in core. Replacing the class behind an existing name does not.
Yes, because Admin Search Mode and Storefront Search Mode are separate settings. As a result, the manager resolves each context on its own.
First, it asks the engine through its connection class, with the values on screen. Then it reports the status, host, version and cluster name.
Run php artisan indexer:index –type=search –mode=full. After that, it calls the active engine’s indexer, whichever engine that is.
In short, Bagisto Search Engines keeps search code free of engine names, so a new engine is a class and a binding, not a rewrite.
Get started today: Follow the Search Engines guide.
If you have more details or questions, you can reply to the received confirmation email.
Back to Home
Be the first to comment.