Download the PHP package novactive/ezalgoliasearchengine without Composer

On this page you can find all versions of the php package novactive/ezalgoliasearchengine. 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 ezalgoliasearchengine

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: https://github.com/Novactive/Nova-eZPlatform-Bundles

Documentation is available in this repository via .md files but also packaged here: https://novactive.github.io/Nova-eZPlatform-Bundles/master/AlgoliaSearchEngine/README.md.html


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:

Installation

Requirements

Installation steps

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

Javascript dependencies

Register the bundle

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

Add routes

ENV variables

The SEARCH_ENGINE environment variable should be set to algolia

Configuration

The Algolia Application should be created on https://www.algolia.com/ 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:

Usage

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

A few of the main Criterions are not implemented yet:

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:

The documentation on this subject can be found here.

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:

You can find more info on the specific boolean filters on Algolia documentation here.

The full Algolia information about how the filtering works can be found here.

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

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_contenttypes parameter or only those included in _include_contenttypes 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

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

The source code of the Front End implementation with React components can be found in the 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:

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.

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

Advanced Usage

Exclude/Include 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:

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:

You can see the default list of the attributes that are sent to Algolia in the Deafult Settings.

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

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. When using it all the request parameters should be specified manually, i.e search term, filters, facets etc. like in the following example:

The Replica can be also specified manually:

Then the created Query instance should be passed to one of the methods of Novactive\Bundle\eZAlgoliaSearchEngine\Core\Search\Search service depending on the type of search:

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


All versions of ezalgoliasearchengine with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3
ext-dom Version *
ext-pdo Version *
ext-json Version *
algolia/algoliasearch-client-php Version ^2.7
ext-openssl Version *
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 novactive/ezalgoliasearchengine contains the following files

Loading the files please wait ....