Download the PHP package glue-agency/craft-elasticsearch without Composer

On this page you can find all versions of the php package glue-agency/craft-elasticsearch. 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 craft-elasticsearch

Elasticsearch

Index Craft Elements to Elasticsearch

Requirements

This plugin requires Craft CMS 5.0.0 or later, and PHP 8.2 or later.

Installation

You can install this plugin from the Plugin Store or with Composer.

With Composer

Open your terminal and run the following commands:

Configuration

If you create a elasticsearch.php file in the config folder you can overwrite the following plugin settings. The config file supports multi env setup.

Extending the Plugin

You can easily add support for custom Craft Fields, or even entirely new Element Types (like Categories or Commerce Products).

Adding Support for Custom Element Types

By default, this plugin indexes Craft Entry elements. To add support for another Element Type (e.g., craft\elements\Category), you need to register four components via Yii2 events:

  1. Criteria: Tells the settings model how to match the element to an index (e.g. by section or entry type).
  2. Filter: Tells the element queries how to filter elements for this index, and whether a given element should be indexed or deleted. Implement apply() to restrict queries, and shouldIndex() to gate indexing per element + index (e.g. based on configurable statuses).
  3. Schema: Defines the Elasticsearch property mappings for the element.
  4. Mapper: Formats the element's data before sending it to Elasticsearch.

Here is an example of how a custom module or plugin can register support for Categories:

Adding Support for Custom Fields

If you are using a third-party Craft field type and want to map it to a specific Elasticsearch data type, you need to register a Property Mapper (defines the Elasticsearch schema type) and a Field Mapper (formats the value).

If you do not register a field mapper for a custom field, the plugin will gracefully fall back to calling $field->serializeValue() and assigning it a standard Elasticsearch text property.


All versions of craft-elasticsearch with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
craftcms/cms Version ^5.0.0
elasticsearch/elasticsearch Version ^8.0
guzzlehttp/guzzle Version ^7.2.0
insolita/yii2-array-structure-validator Version ^2.0.0
illuminate/collections Version ^10.0||^11.0||^12.0
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 glue-agency/craft-elasticsearch contains the following files

Loading the files please wait ...