Download the PHP package pimcore/personalized-product-search without Composer

On this page you can find all versions of the php package pimcore/personalized-product-search. 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 personalized-product-search

Personalized Product Search for Pimcore

This bundle adds the ability to customize Elasticsearch queries searching for products using various personalization criteria, such as browsing history, purchase history of a customer and the customer's assignment to customer groups. The bundle is written in an extensible way so that adding personalization using a custom criteria can easily be achieved. Furthermore, the bundle is designed to be integrated into existing solutions as easily as possible.

For details about the architecture of this bundle please see the corresponding architecture wiki page.

Provided Functionality in a Nutshell

Usage

Install the bundle

Define parameters

Following two parameters need to be defined in your application (default values are provided, but most probably not suitable):

Implement necessary interfaces

The personalized search bundles needs some application dependent data to work. Therefore some interfaces are provided which must be implemented. Additionally, those implementations must be available for dependency injection.

In service.yaml following entries must be added (keep in mind that the implementations can vary).

ProductSegmentExtractorInterface

The implementation of ProductSegmentExtractorInterface is responsible for extracting segments from a product. A default implementation always returns an empty array, so this is an interface that you need to implement and overwrite:

PersonalizationOrderManagerProvider

Provides access to the order manager (part of the ecommerce bundle) as well as the customer class id. A default implementation is provided, you might need to overwrite it.

PersonalizationAdapterCustomerIdProvider

Used to retrieve the id for the currently logged in user. A default implementation is provided that reads the currently logged in user from the symfony security.

In the following example functionality provided by the ecommerce framework is used.

Injecting adapters/decorators

Default adapters (SegmentAdapter, PurchaseHistoryAdapter and RelevantProductsAdapter) and default decorators (EqualWeightDecorator, PerformanceMeasurementDecorator) that are shipped with the Personalization-Bundle are already available via dependency injection. Just make sure all necessary interfaces are implemented and available as explained above.

Here is an example of how the injection of adapters may look like:

Personalizing queries

Adapters modify existing queries. The following example should give an overview of how decorators and adapters can be used:

First, the used decorators and adapters need to be injected, which is not shown in the code snippet. Then a decorator is defined to manage the underlying adapters. Those can easily be added to the decorator using the addAdapter method. After adding adapters addPersonalization can be called for the decorator. It takes the Elasticsearch-query as a parameter. This method returns the modified, personalized, query which can then be executed.

For debug purposes, it might be interesting what the modifications (segments and boosting value for each adapter) looks like. For this case the method getDebugInfo exists.

More detailed information can be found here (decorators)

Using the ETL mechanism

For a detailed documentation of the ETL mechanism including detailed setup instructions please see the corresponding documentation page. The ETL mechanism can be invoked in 3 ways.

Programatically through interfaces which can be injected

Extract purchase history for all customers:

purchaseHistoryProvider->updateOrderIndexFromOrderDb()

Or just for a single customer:

purchaseHistoryProvider->fillOrderIndex(customer)

Updating the customer-group assignments:

customerGroupProvider->updateCustomerGroupAndSegmentsIndicesFromOrderDb()

Via executing a command on the command line

./bin/console personalizedsearch:start-etl ExampleArgument

The argument ExampleArgument is optional. When no argument is given, the ETL is executed for purchase history and relevant products, otherwise only for the given one. The value for the argument can be PurchaseHistory or CustomerGroup.

Via creating cron job entries to automate the invocation

For running the whole ETL every hour, following entry has to be made in the cron tab:

* */1 * * * /home/pimcoredemo/www/bin/console personalizedsearch:start-etl >> /tmp/personalizedsearch-etl.log

For more details about the ETL and its usage see ETL.

Implementing a custom adapter

A custom adapter should extend AbstractAdapter which implements the AdapterInterface. There are two methods to implement: addPersonalization and getDebugInfo. The goal of both methods is to create information on how certain segments are boosted. In addPersonalization this information is used to create so called function scores that are added to the query whereas in getDebugInfo the boosting information is returned. For detailed information on what such an implementation could look like take a look at the default adapters and the more detailed adapter documentation.

Finally, the adapter should be added to services.yml to make it available via dependency injection, just like the default ones. The new entry in the services.yml should look something like this:

Detailed documentation

Load test and architecture

A detailed documentation for the architecture is available under the this link.


All versions of personalized-product-search with dependencies

PHP Build Version
Package Version
Requires elasticsearch/elasticsearch Version ^6 | ^7
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 pimcore/personalized-product-search contains the following files

Loading the files please wait ....