Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 9, 2024 via composer

elasticsearch/elasticsearch v7.17.0

PHP Client for Elasticsearch
Package summary
Share
0
issues
2
licenses
4
MIT
1
(Apache-2.0 OR LGPL-2.1-only)
Package created
24 Sep 2013
Version published
3 Feb 2022
Maintainers
1
Total deps
5
Direct deps
2
License
Apache-2.0 OR LGPL-2.1-only

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
4 Packages, Including:
ezimuel/guzzlestreams@3.1.0
ezimuel/ringphp@1.2.2
psr/log@3.0.0
react/promise@v2.11.0

(Apache-2.0 OR LGPL-2.1-only)

Permissive
1 Packages, Including:
elasticsearch/elasticsearch@v7.17.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

2
All Dependencies CSV
β“˜ This is a list of elasticsearch/elasticsearch 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
ezimuel/ringphp1.2.231.33 kBMIT
prod
psr/log3.0.06.77 kBMIT
prod

Visualizations

Frequently Asked Questions

What does elasticsearch/elasticsearch do?

The Elasticsearch PHP client, also known as "elasticsearch/elasticsearch," is the official PHP client for Elasticsearch. It offers over 400 endpoints to interact with Elasticsearch, facilitating operations such as indexing, searching, updating, and deleting documents. The client is designed to have compatibility with the Elasticsearch server and is versioned and released alongside it. Notably, the 8.0.0 version supports PSR-7 for HTTP messages and PSR-18 for HTTP client communications, reflecting a new approach compared to the 7.x version.

How do you use elasticsearch/elasticsearch?

To utilize the elasticsearch/elasticsearch PHP client, it first needs to be installed in your project. This can typically be done via composer. Upon completion of installation, you can connect to Elasticsearch by referencing the Getting Started documentation's Connecting section. Subsequent usage to index, search, or delete content involves calling relevant API endpoints. For instance, to mock the Elasticsearch client, you may use the PHP-HTTP mock client and implement it as displayed in the README's provided code sample. Attention should be paid to ensure version compatibility between your Elasticsearch server and the PHP client for assured interoperability.

Here is a sample of code to establish an Elasticsearch client and mock an HTTP response:

use Elastic\Elasticsearch\ClientBuilder;
use Elastic\Elasticsearch\Response\Elasticsearch;
use Http\Mock\Client;
use Nyholm\Psr7\Response;

$mock = new Client(); // This is the mock client

$client = ClientBuilder::create()
    ->setHttpClient($mock)
    ->build();

// This is a PSR-7 response
$response = new Response(
    200, 
    [Elasticsearch::HEADER_CHECK => Elasticsearch::PRODUCT_NAME],
    'This is the body!'
);
$mock->addResponse($response);

$result = $client->info(); // Just calling an Elasticsearch endpoint

echo $result->asString(); // This is the body!

Where are the elasticsearch/elasticsearch docs?

The comprehensive documentation for the Elasticsearch PHP client is available on the Elastic website. Specifically, the documents cover topics such as the installation, connecting to Elasticsearch, usage examples for various tasks, versioning, and information about backward incompatible changes. Information about endpoints for interacting with Elasticsearch is also available in the official Elasticsearch APIs documentation. In case you need to report issues with the client or seek help, the Elastic community discuss forums can be quite helpful.