PHPackages                             novactive/ezalgoliasearchengine - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. novactive/ezalgoliasearchengine

AbandonedEzplatform-bundle[Search &amp; Filtering](/categories/search)

novactive/ezalgoliasearchengine
===============================

Novactive eZ Algolia Search Engine is an eZ Platform bundle to provide Algolia search integration.

v1.0.0(5y ago)0581SEE FULL LICENSE OPTIONS IN LICENSE.mdPHPPHP ^7.3

Since Nov 25Pushed 2mo ago8 watchersCompare

[ Source](https://github.com/Novactive/NovaeZAlgoliaSearchEngine)[ Packagist](https://packagist.org/packages/novactive/ezalgoliasearchengine)[ Docs](https://github.com/Novactive/NovaeZAlgoliaSearchEngine)[ RSS](/packages/novactive-ezalgoliasearchengine/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (4)Versions (4)Used By (0)

Novactive eZ Algolia Search Engine Bundle
=========================================

[](#novactive-ez-algolia-search-engine-bundle)

---

This repository is what we call a "subtree split": a read-only copy of one directory of the main repository. It is used by Composer to allow developers to depend on specific bundles.

If you want to report or contribute, you should instead open your issue on the main repository:

Documentation is available in this repository via `.md` files but also packaged here:

---

Novactive eZ Algolia Search Engine is an eZ Platform bundle to provide Algolia search integration, enabling you to use the Algolia Search Engine to index the data and to search.

Thanks to these 3 main features:

- **eZ Repository Search Service Handler implementation**: All basic use cases that are used by eZ Platform to retrieve the contents and locations are managed by this bundle behind the scene thanks to the Repository Search Service. This bunble implements all the visitors that enable the conversion from eZ Query instance (including Criterions, Sort Clauses, Facet Builders) into the request that is sent to Algolia.
- **Algolia PHP Client integration**: Content items are automatically indexed and you can execute Algolia queries directly bypassing the SearchService if you need to. Option is possible to hydrate results into `Content` or `Location` if needed.
- **Algolia Front End**: One of the many Algolia's benefits is the Frontend Components they provide to execute/implement the search using Front End technologies. Simplifying development and providing insane performances. This bundle provides an example of that integration with React JS, with no style, and with Twitter Bootstrap.

Installation
------------

[](#installation)

### Requirements

[](#requirements)

- eZ Platform 3.1+
- PHP 7.3

### Installation steps

[](#installation-steps)

Add the following to your composer.json and run `composer update novactive/ezalgoliasearchengine` to install dependencies:

```
# composer.json

"require": {
    "novactive/ezalgoliasearchengine": "^1.0.0"
}
```

### Javascript dependencies

[](#javascript-dependencies)

```
cd ezplatform
yarn add --dev algoliasearch react react-collapsible react-dom react-instantsearch-dom
```

### Register the bundle

[](#register-the-bundle)

If Symfony Flex did not do it already, activate the bundle in `config\bundles.php` file.

```
// config\bundles.php

return [
    Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
    ...
    Novactive\Bundle\eZAlgoliaSearchEngine\NovaEzAlgoliaSearchEngine::class => ['all' => true],
];
```

### Add routes

[](#add-routes)

```
_novaezalgoliasearchengine_routes:
    resource: '@NovaEzAlgoliaSearchEngine/Resources/config/routing.yaml'
```

### ENV variables

[](#env-variables)

The `SEARCH_ENGINE` environment variable should be set to `algolia`

### Configuration

[](#configuration)

```
nova_ezalgoliasearchengine:
    system:
        default:
            index_name_prefix: PREFIX
            app_id: APPLICATION_ID
            api_secret_key: ADMIN_API_KEY
            api_search_only_key: SEARCH_ONLY_PAI_KEY
            license_key: "CONTACT NOVACTIVE: direction.technique@novactive.com to get your trial"

webpack_encore:
    builds:
        nova_ezalgolia: "%kernel.project_dir%/public/assets/nova_ezalgolia/build"

framework:
    assets:
        packages:
            nova_ezalgolia:
                json_manifest_path: '%kernel.project_dir%/public/assets/nova_ezalgolia/build/manifest.json'
```

> The Algolia Application should be created on  to retrieve the Application ID and the API secret keys. They can be found on the **API Keys** page of the Algolia dashboard.

After having installed the package the following command should be run to init the Indexes on Algolia and set up the search attributes, sort indexes and facets:

```
bin/console nova:ez:algolia:indexes:setup
```

Usage
-----

[](#usage)

### Query Criterions

[](#query-criterions)

All the Criterions created inside the eZ Queries as a filter or query field are transformed into the Algolia filter string like

`doc_type_s:content AND (content_type_identifier_s:"article")`

#### Limitations on Criterions

[](#limitations-on-criterions)

A few of the main [Criterions](https://doc.ezplatform.com/en/master/guide/search/search_criteria_reference/) are not implemented yet:

- Sibling (coming soon)
- ObjectStateIdentifier (coming soon)
- UserEmail (coming soon)
- UserId (coming soon)
- UserLogin (coming soon)
- IsUserBased (coming soon)
- IsUserEnabled (coming soon)
- MapLocationDistance

The User related criterions are not implemented yet because most of them are either included in the UserMetaData Criterion.

The **MapLocationDistance** Criterion is not implemented because the Algolia geo location filter option doesn't allow uss to manage multiple fields of this type within the same document. Filtering by location can be done using the specific request options of the Algolia Search method. Here is the example:

```
    $query->setRequestOption('aroundLatLng', '37.7512306, -122.4584587');
    $query->setRequestOption('aroundRadius', 3000);
```

> The documentation on this subject can be found [here](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/how-to/filter-results-around-a-location/).

The **\_geoloc** attribute is already included in the Algolia document by default for the contents that have the Map Location fields.

Another constraints are inside the Logical operators. They are:

- *FullText* Criterion cannot be inside *LogicalNot* or LogicalOr operator because it's moved to the Algoalia's query string request. Algolia works this way.
- *AND* operator cannot be inside *LogicalNot* criterion;
- *AND/OR* operator cannot be inside *LogicalOr* criterion.

You can find more info on the specific boolean filters on Algolia documentation [here](https://www.algolia.com/doc/api-reference/api-parameters/filters/#boolean-operators).

The full Algolia information about how the filtering works can be found [here](https://www.algolia.com/doc/api-reference/api-parameters/filters/).

### Sorting

[](#sorting)

Sorting with Algolia is based on top of Replicas. Each Replica is a duplicated index with specific configuration on attributes on which the documents are sorted. The attributes that are used to generate the Replicas can be set in the `attributes_for_replicas` config parameter.

When using the eZ Query the **sortClauses** field assigned to the Query instance is converted into the Replica key.

### Reindexing

[](#reindexing)

All the data (Content and Location items) are pushed to the Algolia Index using the `bin/console ezplatform:reindex` command. All of them (except those specified in *exclude\_content\_types* parameter or only those included in *include\_content\_types* parameter) are converted to a specific format and sent to Algolia via saveObjects method. Also each particular Content of allowed Content Type (included or not excluded) is pushed to the Index once published on Ez Platform admin dashboard.

### Front End Implementation

[](#front-end-implementation)

The Search page with `/search` url is overridden with custom Search controller implemented in the Bundle. The specific routing configuration is used for that:

```
ezplatform.search:
    path: /search
    methods: ['GET']
    defaults:
        _controller: 'Novactive\Bundle\eZAlgoliaSearchEngine\Controller\SearchController::searchAction'
```

The source code of the Front End implementation with React components can be found in the [`search.jsx`](bundle/Resources/assets/js/search.jsx) file. All the main widgets are included there and can be used as examples of their implementation. The information on React InstantSearch component basic installation and widgets showcases can be also found in the docs:

- [React search installation](https://www.algolia.com/doc/guides/building-search-ui/installation/react/)
- [React Search Widgets](https://www.algolia.com/doc/guides/building-search-ui/widgets/showcase/react/)

### Security Notes

[](#security-notes)

To restrict the scope of an API key the Secured API keys are used. The Secured API key can be only generated from Search-only API key from the Algolia API keys list. This kind of API key is used when performing the Search method and to prevent possible malicious request tweaks to impersonate another user, so it's done on the Back End side.

In other words, based on the currernt User Permissions, this bundle queries Algolia including permission-related implicit filters to avoid data leaks.

More info [here](https://www.algolia.com/doc/guides/security/api-keys/how-to/user-restricted-access-to-data/?language=php).

> When performing the saveObjects method to create, update or delete the entries of the Ined the Admin API key is used.

### Advanced Usage

[](#advanced-usage)

#### Exclude/Include Content Types from indexation

[](#excludeinclude-content-types-from-indexation)

You can select which Content Types to include or exclude from the Index. Use the following config parameters to exclude or include the specific content types:

- `nova_ezalgoliasearchengine.default.exclude_content_types`
- `nova_ezalgoliasearchengine.default.include_content_types`

The `include` parameter is checked first and hence has the priority. By default all the content types are saved to the Index except **User** and **User Group**.

There are also the following parameters:

- Searchable Attributes;
- Attributes for Faceting;
- Attributes to Retrieve;
- Attributes for Replicas (used for sorting);

You can see the default list of the attributes that are sent to Algolia in the [Deafult Settings](https://github.com/Novactive/NovaeZAlgoliaSearchEngine/blob/master/bundle/Resources/config/default_settings.yaml).

To send all those setting to Algolia use the `bin/console nova:ez:algolia:indexes:setup` command.

#### Using the Query Factory to generate the custom queries

[](#using-the-query-factory-to-generate-the-custom-queries)

If you want to create more specific custom request that can be achieved with the Search Query Factory service [`Novactive\Bundle\eZAlgoliaSearchEngine\Core\Search\SearchQueryFactory`](https://github.com/Novactive/NovaeZAlgoliaSearchEngine/blob/master/bundle/Core/Search/SearchQueryFactory.php). When using it all the request parameters should be specified manually, i.e search term, filters, facets etc. like in the following example:

```
    $query = $this->searchQueryFactory->create(
        'term',
        'content_type_identifier_s:"article"',
        ['doc_type_s']
    );
    $query->setRequestOption('attributesToRetrieve', ['content_name_s']);
```

The Replica can be also specified manually:

```
    $query = $this->searchQueryFactory->create(
        '',
        'content_language_codes_ms:"eng-GB"',
    );
    $query->setReplicaByAttribute('location_id_i');
```

Then the created Query instance should be passed to one of the methods of [`Novactive\Bundle\eZAlgoliaSearchEngine\Core\Search\Search`](bundle/Core/Search/Search.php) service depending on the type of search:

- findContents
- findLocations
- find (for the raw search).

> There is also an event that enables you to tweak the `Query` created by the factory. `Novactive\Bundle\eZAlgoliaSearchEngine\Event\QueryCreateEvent`

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance56

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1994d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/246ac802ccaf4e1b674e1b0200673c56fafb89ef9130a6f7d2e2d9e5b9f71a03?d=identicon)[Plopix](/maintainers/Plopix)

---

Top Contributors

[![Plopix](https://avatars.githubusercontent.com/u/313532?v=4)](https://github.com/Plopix "Plopix (2 commits)")[![maximstrukov](https://avatars.githubusercontent.com/u/15006962?v=4)](https://github.com/maximstrukov "maximstrukov (1 commits)")

---

Tags

searchperformancealgoliaindexnovactiveezplatform

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/novactive-ezalgoliasearchengine/health.svg)

```
[![Health](https://phpackages.com/badges/novactive-ezalgoliasearchengine/health.svg)](https://phpackages.com/packages/novactive-ezalgoliasearchengine)
```

###  Alternatives

[algolia/scout-extended

Scout Extended extends Laravel Scout adding algolia-specific features

4186.3M6](/packages/algolia-scout-extended)[terminal42/escargot

A web crawler or spider library based on Symfony components

581.4M3](/packages/terminal42-escargot)[algolia/laravel-scout-settings

Import/Export Algolia settings into your Laravel Scout project

23396.9k](/packages/algolia-laravel-scout-settings)[cmsig/seal

Search Engine Abstraction Layer

32207.9k53](/packages/cmsig-seal)[opensearchserver/opensearchserver

PHP library for OpenSearchServer: professionnal search engine, crawlers (web, file, database), REST APIs, .... This library uses OpenSearchServer's V2 API.

5267.5k](/packages/opensearchserver-opensearchserver)[cmsig/seal-symfony-bundle

An integration of CMS-IG SEAL search abstraction into Symfony Framework.

15195.8k5](/packages/cmsig-seal-symfony-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
