Download the PHP package spryker-eco/algolia without Composer

On this page you can find all versions of the php package spryker-eco/algolia. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package algolia

Algolia Module

Latest Stable Version Minimum PHP Version

The Algolia module provides seamless integration between Spryker Commerce OS and Algolia search service, enabling real-time synchronization of products and CMS pages to Algolia indices for fast, relevant search experiences.

Features

Table of Contents

Installation

Step 1: Configure Algolia Credentials

Option A: Environment variable-based credentials

Set the values in your config file.

Option B: Back Office configuration

Requires the Spryker Configuration feature to be installed. Once installed, activate it for this module by creating src/Pyz/Shared/Algolia/AlgoliaConfig.php:

Run the following command to sync the configuration settings to the database. This registers the Algolia configuration keys used by the Back Office:

Configure Algolia credentials in the Back Office under Configuration > Integrations > Algolia. Enter the Application ID, Admin API Key, and Search-Only API Key.

To enable credential validation on save, register AlgoliaCredentialsPreSavePlugin in src/Pyz/Zed/Configuration/ConfigurationDependencyProvider.php:

Step 2: Configure Tenant Identifier (optional)

If you use one Algolia account for multiple environments, set a tenant identifier to use as an index prefix (default is "production"). This is an environment-level concern and is always configured in the config file, regardless of which credential option you chose in Step 1:

Step 3: Enable Console Command

File: src/Pyz/Zed/Console/ConsoleDependencyProvider.php

Step 4: Configure Entity Exporter Plugins

File: src/Pyz/Zed/Algolia/AlgoliaDependencyProvider.php

Step 5: Configure Search Adapter Plugin

File: src/Pyz/Client/Search/SearchDependencyProvider.php

Step 6: Configure Catalog Search Query Plugins

Note: Also requires the catalog search provider to be set to Algolia — either by overriding isSearchInFrontendEnabledForProducts() to return true in src/Pyz/Shared/Algolia/AlgoliaConfig.php (Option A), or via Back Office under Configuration > Catalog > Search (Option B).

Note 2: Integration heavily depends on SearchHttp module plugins, so they have to be also enabled in src/Pyz/Client/Catalog/CatalogDependencyProvider.php, see the integration guide.

File: src/Pyz/Client/Catalog/CatalogDependencyProvider.php

Step 7: Configure CMS Page Search Query Plugin (Optional)

Note: Also requires the CMS search provider to be set to Algolia — either by overriding isSearchInFrontendEnabledForCmsPages() to return true in src/Pyz/Shared/Algolia/AlgoliaConfig.php (Option A), or via Back Office under Configuration > CMS > Search (Option B).

Note 2: Integration heavily depends on SearchHttp module plugins, so they have to be also enabled in src/Pyz/Client/SearchHttp/SearchHttpDependencyProvider.php and src/Pyz/Client/CmsPageSearch/CmsPageSearchDependencyProvider.php, see the integration guide.

File: src/Pyz/Client/CmsPageSearch/CmsPageSearchDependencyProvider.php

Step 8: Generate Transfers

Step 9: Verify Installation

Step 10: Send data to Algolia

See Full Indexing section for more details and scheduling options.

See Real-time Synchronization section for real-time updates.

Step 11: Verify data in the Algolia Dashboard

  1. Log in to Algolia
  2. Check created indexes and data inside (Search section).
  3. Try searches from the Algolia Dashboard.
  4. Tune index settings (facets, searchable attributes) as needed.

Step 12: Configure Real-time Synchronization

Complete Integration Example:

See Real-time Synchronization section for details on each plugin and its subscribed events.

Step 13: Enable Search in Frontend & API

⚠️ WARNING: Please ensure you have data in the Algolia indices before enabling search in the frontend; otherwise, search will return no results.

Set the search provider to Algolia using one of the following approaches:

Option A (code-level configuration): add to src/Pyz/Shared/Algolia/AlgoliaConfig.php:

Option B (Configuration module): set the search provider in the Back Office under Configuration > Catalog > Search and Configuration > CMS > Search.


Real-time Synchronization

Product Publisher Plugins

Located in: SprykerEco\Zed\Algolia\Communication\Plugin\Publisher\Product\

1. AlgoliaProductConcretePublisherPlugin

Purpose: Publishes product concrete (variant) data to Algolia when products are created or updated.

Default Subscribed Events:

Behavior:

2. AlgoliaProductAbstractPublisherPlugin

Purpose: Publishes all concrete products of a product abstract when abstract-level data changes.

Default Subscribed Events:

Behavior:

3. AlgoliaProductConcreteDeletePublisherPlugin

Purpose: Removes deleted products from Algolia indices.

Default Subscribed Events:

Behavior:


CMS Page Publisher Plugins

Located in: SprykerEco\Zed\Algolia\Communication\Plugin\Publisher\CmsPage\

1. AlgoliaCmsPagePublisherPlugin

Purpose: Publishes CMS page data to Algolia when pages are created or updated.

Default Subscribed Events:

Behavior:

2. AlgoliaCmsPageVersionPublisherPlugin

Purpose: Publishes CMS pages when new versions are created or published.

Default Subscribed Events:

Behavior:


Full Indexing

Usage Examples

Schedule Automatic Exports (Recommended)

For periodic full re-indexing, add a cron job to export entities to Algolia on a scheduled basis.

File: config/Zed/cronjobs/jenkins.php

Schedule explanation:

Note: These cron jobs complement the real-time publisher plugins. The publishers handle incremental updates, while the cron jobs ensure full data consistency by performing periodic complete exports.


Custom Entity Index Mapping

The Algolia module supports searching custom entities that are already indexed in Algolia but are not natively supported by the module (like products or CMS pages). This feature allows you to integrate any custom entity search without creating new plugins or modules.

When to Use

Use entity-to-index mapping when you:

Quick Setup

Step 1: Configure the mapping in your shared config:

Step 2: Create a search query plugin:

Step 3: Use the plugin in your dependency provider and execute search.

For a complete implementation guide with examples, see Custom Entity Index Mapping Guide.


Configuration

Available Configuration Methods

Product Events:

CMS Page Events:

Search:

Sorting (Replica Indices):

Example project-level configuration in src/Pyz/Zed/Algolia/AlgoliaConfig.php:

Sort Parameter Mapping (Client):

Example in src/Pyz/Client/Algolia/AlgoliaConfig.php:

Query Suggestions:

Example:

Insights & Analytics & Personalization:

Default Event Subscriptions

All publisher plugins get their subscribed events from AlgoliaConfig. The config automatically includes events from optional modules if they exist:

For Products:

For CMS Pages:

Customizing Event Subscriptions

Extend AlgoliaConfig in your project to customize events:


Architecture

Data Flow

Event Consolidation

Products:

CMS Pages:


Troubleshooting

No entity types available

Problem: "No entity exporters are registered"

Solution:

  1. Ensure plugins are registered in AlgoliaDependencyProvider::getAlgoliaEntityExporterPlugins()
  2. Check the dependency provider is in Pyz namespace if extended
  3. Clear cache: console cache:empty-all

Transfer not found

Problem: Class 'Generated\Shared\Transfer\AlgoliaExportCriteriaTransfer' not found

Solution:

Events not triggering

Problem: Changes not appearing in Algolia

Solution:

  1. Check AlgoliaConfig::getIsActive() returns true — ensure Application ID, Admin API Key, and Search-Only API Key are all set up
  2. Verify publisher plugins are registered in PublisherDependencyProvider
  3. Check queue workers are running:

  4. Debug publishing with Xdebug docker/sdk console -x queue:task:start publish or using logs.

Search requests are failing

Problem: Search queries return errors or no results

Solution:

  1. Verify Algolia credentials in the config/Back Office (Configuration > Integrations > Algolia) are correct
  2. Ensure indices exist in Algolia dashboard
  3. Disable personalization getIsPersonalizationEnabled() if you do not use an Algolia premium plan.

Migration from ACP Algolia App

If migrating from MessageBroker-based Algolia ACP App:

Note: The logic of data synchronization remains the same, so if you don't want to re-synchronize all data to Algolia, just use TENANT_IDENTIFIER the same as ACP tenant ID:

Step 1: Remove Old ACP Plugins and Configuration

1a. Remove from src/Pyz/Zed/Publisher/PublisherDependencyProvider.php

Remove these imports and their usages:

Remove the methods that register them (e.g., getProductMessageBrokerPlugins(), getCmsPageMessageBrokerPlugins()) and their calls from getPublisherPlugins().

Also keep ProductCategoryProductUpdatedEventTriggerPlugin and ProductLabelProductUpdatedEventTriggerPlugin — they are not ACP-specific and must remain (they will be re-registered under the new Algolia plugins method in Step 2).

1b. Remove from src/Pyz/Zed/MessageBroker/MessageBrokerDependencyProvider.php

1c. Disable MessageBroker publishing in config/Shared/config_default.php

1d. Configure Algolia credentials and tenant identifier

Follow Step 2: Configure Tenant Identifier from the Installation section. Use your existing ACP credentials.

If preserving the existing ACP tenant identifier (to avoid re-indexing), set TENANT_IDENTIFIER to match the old ACP tenant ID:

1e. Update src/Pyz/Client/Search/SearchDependencyProvider.php

Replace SearchHttpSearchAdapterPlugin with AlgoliaSearchAdapterPlugin and remove SearchHttpSearchContextExpanderPlugin:

In getClientAdapterPlugins() replace new SearchHttpSearchAdapterPlugin() with new AlgoliaSearchAdapterPlugin().

In getSearchContextExpanderPlugins() remove new SearchHttpSearchContextExpanderPlugin().

1f. Update src/Pyz/Client/Catalog/CatalogDependencyProvider.php

Replace SearchHttp query plugins with Algolia equivalents:

Replace plugin instantiations:

1g. Update src/Pyz/Client/CmsPageSearch/CmsPageSearchDependencyProvider.php

Replace new SearchHttpQueryPlugin(...) with new AlgoliaSearchQueryPlugin(...) in getCmsPageSearchQueryPlugins().

Step 2: Add New Algolia Integration

2a. Register the console export command

File: src/Pyz/Zed/Console/ConsoleDependencyProvider.php

2b. Create src/Pyz/Zed/Algolia/AlgoliaDependencyProvider.php

2c. Register real-time publisher plugins

File: src/Pyz/Zed/Publisher/PublisherDependencyProvider.php

Add a new getAlgoliaPlugins() method and call it from getPublisherPlugins():

2d. Enable frontend search

Set the search provider to Algolia using one of the following approaches:

Option A (code-level configuration): add to src/Pyz/Shared/Algolia/AlgoliaConfig.php:

Option B (Configuration module): set it in the Back Office under Configuration > Catalog > Search and Configuration > CMS > Search.

2e. Generate transfers

Step 3: Initial Data Export and Verify

Benefits of Migration


Performance Considerations

Products

CMS Pages

General


Support

For issues or questions:

Development

To check/fix code style and run static analysis, use:

For test execution, check the details in tests/README.md file.

License

This module is licensed under the same license as Spryker Commerce OS.


All versions of algolia with dependencies

PHP Build Version
Package Version
Requires algolia/algoliasearch-client-php Version 4.46.3
ext-curl Version *
ext-intl Version *
ext-json Version *
php Version >=8.3
spryker-shop/traceable-event-widget Version ^1.1.0
spryker/cms Version ^7.18.0
spryker/configuration-extension Version ^1.0.0
spryker/customer Version ^7.70.0
spryker/event-behavior Version ^1.32.0
spryker/http Version ^1.15.0
spryker/kernel Version ^3.84.0
spryker/locale Version ^4.12.0
spryker/log Version ^3.18.0
spryker/product Version ^6.53.0
spryker/product-category Version ^4.28.1
spryker/product-image Version ^3.20.0
spryker/publisher-extension Version ^1.0.0
spryker/search-extension Version ^1.4.0
spryker/search-http Version ^0.5.9
spryker/store Version ^1.36.1
spryker/symfony Version ^3.19.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package spryker-eco/algolia contains the following files

Loading the files please wait ...