Download the PHP package wa72/es-tools without Composer

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

PHP Helpers for Elasticsearch and OpenSearch

Tests

Convenience classes for the official Elasticsearch and OpenSearch PHP clients.

The tools in this repo are primarily written for my personal use but may be helpful for others too.

Currently the project contains the following classes:

Initially, the focus was on the IndexHelper class mainly for easy managing of index versioning (e.g., initially you have an index my-index, then create a new version my-index-1 and set my-index as an alias for my-index-1). The SearchScrollHelper was needed for easy re-indexing existing data from the old to the new index version. Nowadays, the Index class is the convenient entry point for all actions on an Elasticsearch or OpenSearch index: managing mapping, settings, and versions, as well as indexing, querying, retrieving, and deleting documents.

There is also wasinger/elasticsearch-bundle for integrating these tools in a Symfony project.

Compatibility

Install the client for your search engine explicitly. Client packages are optional runtime dependencies, so OpenSearch applications do not need the Elasticsearch client and Elasticsearch applications do not need the OpenSearch client. Existing Elasticsearch applications should declare elasticsearch/elasticsearch in their own composer.json if they previously relied on this library to install it.

Server PHP client package Supported client versions
Elasticsearch 6.8 elasticsearch/elasticsearch ^6.8.4
Elasticsearch 7.17 elasticsearch/elasticsearch ^7.17
Elasticsearch 8.19 elasticsearch/elasticsearch ^8.19
Elasticsearch 9.x elasticsearch/elasticsearch ^9.0
OpenSearch 2.x and 3.x opensearch-project/opensearch-php ^2.7

CI tests PHP 8.3, 8.4, and 8.5 against Elasticsearch 6.8.23, 7.17.29, 8.19.23, and 9.5.5, and OpenSearch 2.19.6 and 3.9.0. Each job installs only the client for its selected engine and runs the complete suite.

Both legacy single-type mappings (['_doc' => ['properties' => [...]]]) and modern typeless mappings (['properties' => [...]]) are accepted, optionally wrapped in a mappings key. Types are omitted from requests to OpenSearch and Elasticsearch 7 and newer. Multiple mapping types are not supported. Mapping differences use the server's mapping structure (typed on Elasticsearch 6.x, typeless otherwise).

Pass a native client to the helpers as before. Versions 6/7 use Elasticsearch\ClientBuilder; versions 8/9 use Elastic\Elasticsearch\ClientBuilder. Use a URL including http:// or https:// when configuring modern clients. Elasticsearch 9 requires a PSR-18 HTTP client, for example composer require guzzlehttp/guzzle.

Library methods continue to return arrays and booleans across all client versions. getClient() returns the original native client; getElasticsearchClient() remains available as an alias for either engine. Missing documents return null from get() and are safe to delete. Other client or server errors are propagated.

Using OpenSearch

Install the OpenSearch client and Guzzle HTTP transport:

Pass the native OpenSearch client to any helper:

IndexHelper and SearchScrollHelper accept the same client. Mapping management, version aliases, reindexing, bulk indexing, cleanup, and scrolling use the same library API for both engines. Configure authentication and TLS on the native client when connecting to a secured cluster.

Running tests

Integration tests need a running server compatible with the selected client. Set SEARCH_ENGINE=opensearch to select OpenSearch; the default is elasticsearch. By default localhost:9200 is used; another host can be set with ES_HOST. For example, to test Elasticsearch 9:

To run against OpenSearch instead:

If the selected server is not available, integration tests are skipped (or fail if CI is set). Mapping normalization and utility tests do not require a server.

Run the GitHub Actions workflow locally using nektos/act:

When working behind an HTTP proxy, pass the proxy settings to the job containers, e.g. act push -j test --concurrent-jobs 1 --env https_proxy=$https_proxy --env http_proxy=$http_proxy --env no_proxy=localhost,127.0.0.1,search.


All versions of es-tools with dependencies

PHP Build Version
Package Version
Requires php Version ^8
psr/log Version ^1|^2|^3
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 wa72/es-tools contains the following files

Loading the files please wait ...