Official PHP low-level client for Elasticsearch.

Overview

elasticsearch-php

Build status Latest Stable Version Total Downloads

Official low-level client for Elasticsearch. Its goal is to provide common ground for all Elasticsearch-related code in PHP; because of this it tries to be opinion-free and very extendable.

To maintain consistency across all the low-level clients (Ruby, Python, etc.), clients accept simple associative arrays as parameters. All parameters, from the URI to the document body, are defined in the associative array.

Starting from version 7.4.0, all the endpoints (and namespaces) are autogenerated using the util/GenerateEndpoints.php script. This script reads the Elasticsearch API specs and generates the PHP classes for all the endpoints.

Starting from version 7.7.0 we included also the XPack endpoints of Elasticsearch. These APIs are related to:

Table of Contents

Features

  • One-to-one mapping with REST API and other language clients
  • Configurable, automatic discovery of cluster nodes
  • Persistent, Keep-Alive connections (within the lifetime of the script)
  • Load balancing (with pluggable selection strategy) across all available nodes. Defaults to round-robin
  • Pluggable connection pools to offer different connection strategies
  • Generalized, pluggable architecture - most components can be replaced with your own custom class if specialized behavior is required
  • Option to use asynchronous future, which enables parallel execution of curl requests to multiple nodes

Note: X-Pack endpoints are included from elasticsearch-php 7.7+.

Version Matrix

Elasticsearch Version Elasticsearch-PHP Branch
>= 7.x 7.x
>= 6.6, < 7.0 6.7.x
>= 6.0, < 6.6 6.5.x
>= 5.0, < 6.0 5.0
>= 2.0, < 5.0 1.0 or 2.0
>= 1.0, < 2.0 1.0 or 2.0
<= 0.90.x 0.4
  • If you are using Elasticsearch 7.x you can use Elasticsearch-PHP 7.x branch
  • If you are using Elasticsearch 6.6 to 6.7, use Elasticsearch-PHP 6.7.x branch.
  • If you are using Elasticsearch 6.0 to 6.5, use Elasticsearch-PHP 6.5.x branch.
  • If you are using Elasticsearch 5.x, use Elasticsearch-PHP 5.0 branch.
  • If you are using Elasticsearch 1.x or 2.x, prefer using the Elasticsearch-PHP 2.0 branch. The 1.0 branch is compatible however.
  • If you are using a version older than 1.0, you must install the 0.4 Elasticsearch-PHP branch. Since ES 0.90.x and below is now EOL, the corresponding 0.4 branch will not receive any more development or bugfixes. Please upgrade.
  • You should never use Elasticsearch-PHP Master branch, as it tracks Elasticsearch master and may contain incomplete features or breaks in backwards compatibility. Only use ES-PHP master if you are developing against ES master for some reason.

Compatibility

Language clients are forward compatible; meaning that clients support communicating with greater or equal minor versions of Elasticsearch. Elasticsearch language clients are only backwards compatible with default distributions and without guarantees made.

Documentation

Full documentation can be found here. Docs are stored within the repo under /docs/, so if you see a typo or problem, please submit a PR to fix it!

We also provide a code examples generator for PHP using the util/GenerateDocExamples.php script. This command parses the util/alternative_report.spec.json file produced from this JSON specification and it generates the PHP examples for each digest value. The examples are stored in asciidoc format under docs/examples folder.

Installation via Composer

The recommended method to install Elasticsearch-PHP is through Composer.

  1. Add elasticsearch/elasticsearch as a dependency in your project's composer.json file (change version to suit your version of Elasticsearch, for instance for ES 7.0):

        {
            "require": {
                "elasticsearch/elasticsearch": "^7.0"
            }
        }
  2. Download and install Composer:

        curl -s http://getcomposer.org/installer | php
  3. Install your dependencies:

        php composer.phar install
  4. Require Composer's autoloader

    Composer also prepares an autoload file that's capable of autoloading all the classes in any of the libraries that it downloads. To use it, just add the following line to your code's bootstrap process:

        <?php
    
        use Elasticsearch\ClientBuilder;
    
        require 'vendor/autoload.php';
    
        $client = ClientBuilder::create()->build();

You can find out more on how to install Composer, configure autoloading, and other best-practices for defining dependencies at getcomposer.org.

PHP Version Requirement

Version 7.0 of this library requires at least PHP version 7.1. In addition, it requires the native JSON extension to be version 1.3.7 or higher.

Elasticsearch-PHP Branch PHP Version
7.0 >= 7.1.0
6.0 >= 7.0.0
5.0 >= 5.6.6
2.0 >= 5.4.0
0.4, 1.0 >= 5.3.9

Quickstart

Index a document

In elasticsearch-php, almost everything is configured by associative arrays. The REST endpoint, document and optional parameters - everything is an associative array.

To index a document, we need to specify three pieces of information: index, id and a document body. This is done by constructing an associative array of key:value pairs. The request body is itself an associative array with key:value pairs corresponding to the data in your document:

$params = [
    'index' => 'my_index',
    'id'    => 'my_id',
    'body'  => ['testField' => 'abc']
];

$response = $client->index($params);
print_r($response);

The response that you get back indicates the document was created in the index that you specified. The response is an associative array containing a decoded version of the JSON that Elasticsearch returns:

Array
(
    [_index] => my_index
    [_type] => _doc
    [_id] => my_id
    [_version] => 1
    [result] => created
    [_shards] => Array
        (
            [total] => 1
            [successful] => 1
            [failed] => 0
        )

    [_seq_no] => 0
    [_primary_term] => 1
)

Get a document

Let's get the document that we just indexed. This will simply return the document:

$params = [
    'index' => 'my_index',
    'id'    => 'my_id'
];

$response = $client->get($params);
print_r($response);

The response contains some metadata (index, version, etc.) as well as a _source field, which is the original document that you sent to Elasticsearch.

Array
(
    [_index] => my_index
    [_type] => _doc
    [_id] => my_id
    [_version] => 1
    [_seq_no] => 0
    [_primary_term] => 1
    [found] => 1
    [_source] => Array
        (
            [testField] => abc
        )

)

If you want to retrieve the _source field directly, there is the getSource method:

$params = [
    'index' => 'my_index',
    'id'    => 'my_id'
];

$source = $client->getSource($params);
print_r($source);

The response will be just the _source value:

Array
(
    [testField] => abc
)

Search for a document

Searching is a hallmark of Elasticsearch, so let's perform a search. We are going to use the Match query as a demonstration:

$params = [
    'index' => 'my_index',
    'body'  => [
        'query' => [
            'match' => [
                'testField' => 'abc'
            ]
        ]
    ]
];

$response = $client->search($params);
print_r($response);

The response is a little different from the previous responses. We see some metadata (took, timed_out, etc.) and an array named hits. This represents your search results. Inside of hits is another array named hits, which contains individual search results:

Array
(
    [took] => 33
    [timed_out] =>
    [_shards] => Array
        (
            [total] => 1
            [successful] => 1
            [skipped] => 0
            [failed] => 0
        )

    [hits] => Array
        (
            [total] => Array
                (
                    [value] => 1
                    [relation] => eq
                )

            [max_score] => 0.2876821
            [hits] => Array
                (
                    [0] => Array
                        (
                            [_index] => my_index
                            [_type] => _doc
                            [_id] => my_id
                            [_score] => 0.2876821
                            [_source] => Array
                                (
                                    [testField] => abc
                                )

                        )

                )

        )

)

Delete a document

Alright, let's go ahead and delete the document that we added previously:

$params = [
    'index' => 'my_index',
    'id'    => 'my_id'
];

$response = $client->delete($params);
print_r($response);

You'll notice this is identical syntax to the get syntax. The only difference is the operation: delete instead of get. The response will confirm the document was deleted:

Array
(
    [_index] => my_index
    [_type] => _doc
    [_id] => my_id
    [_version] => 2
    [result] => deleted
    [_shards] => Array
        (
            [total] => 1
            [successful] => 1
            [failed] => 0
        )

    [_seq_no] => 1
    [_primary_term] => 1
)

Delete an index

Due to the dynamic nature of Elasticsearch, the first document we added automatically built an index with some default settings. Let's delete that index because we want to specify our own settings later:

$deleteParams = [
    'index' => 'my_index'
];
$response = $client->indices()->delete($deleteParams);
print_r($response);

The response:

Array
(
    [acknowledged] => 1
)

Create an index

Now that we are starting fresh (no data or index), let's add a new index with some custom settings:

$params = [
    'index' => 'my_index',
    'body'  => [
        'settings' => [
            'number_of_shards' => 2,
            'number_of_replicas' => 0
        ]
    ]
];

$response = $client->indices()->create($params);
print_r($response);

Elasticsearch will now create that index with your chosen settings, and return an acknowledgement:

Array
(
    [acknowledged] => 1
)

Unit Testing using Mock a Elastic Client

use GuzzleHttp\Ring\Client\MockHandler;
use Elasticsearch\ClientBuilder;

// The connection class requires 'body' to be a file stream handle
// Depending on what kind of request you do, you may need to set more values here
$handler = new MockHandler([
  'status' => 200,
  'transfer_stats' => [
     'total_time' => 100
  ],
  'body' => fopen('somefile.json'),
  'effective_url' => 'localhost'
]);
$builder = ClientBuilder::create();
$builder->setHosts(['somehost']);
$builder->setHandler($handler);
$client = $builder->build();
// Do a request and you'll get back the 'body' response above

Contributing

If you want to contribute to this project you need to subscribe to a Contributor Agreement. If you want to send a PR for version Y please use the Y.x branch. For instance if you want to send a PR for elasticsearch-php 7 use the 7.x branch.

Never send PR to master unless you want to contribute to the development version of the client (master represents the next major version).

Each PR should include a unit test using PHPUnit. If you are not familiar with PHPUnit you can have a look at this reference.

Wrap up

That was just a crash-course overview of the client and its syntax. If you are familiar with Elasticsearch, you'll notice that the methods are named just like REST endpoints.

You'll also notice that the client is configured in a manner that facilitates easy discovery via the IDE. All core actions are available under the $client object (indexing, searching, getting, etc.). Index and cluster management are located under the $client->indices() and $client->cluster() objects, respectively.

Check out the rest of the Documentation to see how the entire client works.

Available Licenses

Starting with version 1.3.1, Elasticsearch-PHP is available under two licenses: Apache v2.0 and LGPL v2.1. Versions prior to 1.3.1 are still licensed with only Apache v2.0.

The user may choose which license they wish to use. Since there is no discriminating executable or distribution bundle to differentiate licensing, the user should document their license choice externally, in case the library is re-distributed. If no explicit choice is made, assumption is that redistribution obeys rules of both licenses.

Contributions

All contributions to the library are to be so that they can be licensed under both licenses.

Apache v2.0 License:

Copyright 2013-2016 Elasticsearch

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

LGPL v2.1 Notice:

Copyright (C) 2013-2016 Elasticsearch

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Comments
  • Bulk Indexing

    Bulk Indexing

    Hello,

    My name is Austin Harmon and I am new to elastic search. I am looking to index a couple hundred thousand documents with elastic search and I would like to use the php client to do it. I have my index set up with one shard and one replica since I have a smaller amount of documents. I have looked over all the syntax on the elastic search site and github. This is what my index.php file looks like:

    array( 'index' => 'rvuehistoricaldocuments2009-2013', 'type' => 'documents', '_id' => $i, 'body' => array( '_source' => array( //everthing in body is mapping code 'enabled' => true ), 'properties' => array( 'doc_name' => array( 'type' => 'string', 'analyzer' => 'standard' ), 'description' => array( 'type' => 'string' ) ) ); $params['body'][] = array ( 'rVuedoc'$i => 'ID'$i ); $indexParams['body']['mappings']['documents'] = $myTypeMapping; //mapping code } json_encode($params); $client->indices()->create($indexParams); //mapping code $responses = $client->bulk($params); ``` ?>

    I'm not sure if I have everything I need or if I'm doing this right so if you could let me know if this looks correct that would be very helpful.

    Thank you, Austin Harmon

    opened by Blackhawk2165 35
  • Compatibility issues with version 7.4.0

    Compatibility issues with version 7.4.0

    Summary of problem or feature request

    Since version 7.4.0 was published, it seems some classes were renamed which break compatiblity.

    For example, Elasticsearch\Endpoints\Ingest\Pipeline\Delete was renamed to Elasticsearch\Endpoints\Ingest\DeletePipeline

    See https://github.com/ruflin/Elastica/issues/1710 for reference.

    opened by deguif 29
  • No alive nodes found in your cluster in v5.0

    No alive nodes found in your cluster in v5.0

    Summary of problem or feature request

    I am using the search feature of elastic search but this error is coming out while running my files on localhost.

    my configuration code:

    use Elasticsearch\ClientBuilder;

    require 'vendor/autoload.php'; $client = Elasticsearch\ClientBuilder::create()->build();

    the error while sending a query for search :

    Fatal error: Uncaught Elasticsearch\Common\Exceptions\NoNodesAvailableException: No alive nodes found in your cluster in C:\xampp\htdocs\elastic\vendor\elasticsearch\elasticsearch\src\Elasticsearch\ConnectionPool\StaticNoPingConnectionPool.php:51 Stack trace: #0 C:\xampp\htdocs\elastic\vendor\elasticsearch\elasticsearch\src\Elasticsearch\Transport.php(72): Elasticsearch\ConnectionPool\StaticNoPingConnectionPool->nextConnection() #1 C:\xampp\htdocs\elastic\vendor\elasticsearch\elasticsearch\src\Elasticsearch\Transport.php(90): Elasticsearch\Transport->getConnection() #2 C:\xampp\htdocs\elastic\vendor\elasticsearch\elasticsearch\src\Elasticsearch\Connections\Connection.php(227): Elasticsearch\Transport->performRequest('GET', '/1/books/_searc...', Array, '{"query":{"matc...', Array) #3 C:\xampp\htdocs\elastic\vendor\react\promise\src\FulfilledPromise.php(25): Elasticsearch\Connections\Connection->Elasticsearch\Connections{closure}(Array) #4 C:\xampp\htdocs\elastic\vendor\guzzlehttp\ringphp\src\Future\CompletedFutureValue.ph in C:\xampp\htdocs\elastic\vendor\elasticsearch\elasticsearch\src\Elasticsearch\ConnectionPool\StaticNoPingConnectionPool.php on line 51

    please help me fix this problem. I am using localhost through XAMPP.

    • Operating System - windows
    • PHP Version - 7
    • ES-PHP client version - v5.0
    • Elasticsearch version - v5.0
    opened by zmf0507 26
  • Supporting PSR-7 and PSR-18 for HTTP transport layer

    Supporting PSR-7 and PSR-18 for HTTP transport layer

    We would like to support PSR-7 and PSR-18 for the HTTP transport layer. We was thinking to use HTTPlug in order to use an abstraction with some adapter implementations. As default adapter we can use CURL as we are already using it in the client. The idea is to release this with elasticsearch-php 8.0.

    Any feedback? thanks!

    enhancement 8.0 
    opened by ezimuel 22
  • Port is missing from log messages

    Port is missing from log messages

    Summary of problem or feature request

    I can see that in v.7 the port has disappeared from the host. After further digging I see it's been specifically requested and fixed in https://github.com/elastic/elasticsearch-php/issues/548 & https://github.com/elastic/elasticsearch-php/pull/782

    Perhaps it is a valid use case (although I don't really understand it), but the change seems to be causing problems elsewhere - now the port is missing from the log messages too.

    Code snippet of problem

    Here is an example of what is sent to the logger now:

    array(8) {
      ["message"]=>
      string(66) "curl -XDELETE 'http://127.0.0.1/sineflow-esb-test-bar?pretty=true'"
      ["context"]=>
      array(0) {
      }
      ["level"]=>
      int(200)
      ["level_name"]=>
      string(4) "INFO"
      ["channel"]=>
      string(10) "sfes_trace"
      ["datetime"]=>
      object(DateTime)#108 (3) {
        ["date"]=>
        string(26) "2019-08-03 12:53:10.801795"
        ["timezone_type"]=>
        int(3)
        ["timezone"]=>
        string(15) "Europe/Helsinki"
      }
      ["extra"]=>
      array(1) {
        ["backtrace"]=>
        NULL
      }
      ["formatted"]=>
      string(112) "[2019-08-03 12:53:10] sfes_trace.INFO: curl -XDELETE 'http://127.0.0.1/sineflow-esb-test-bar?pretty=true' [] []
    "
    }
    array(8) {
      ["message"]=>
      string(9) "Response:"
      ["context"]=>
      array(5) {
        ["response"]=>
        array(1) {
          ["acknowledged"]=>
          bool(true)
        }
        ["method"]=>
        string(6) "DELETE"
        ["uri"]=>
        string(38) "http://127.0.0.1/sineflow-esb-test-bar"
        ["HTTP code"]=>
        int(200)
        ["duration"]=>
        float(0.026726)
      }
      ["level"]=>
      int(100)
      ["level_name"]=>
      string(5) "DEBUG"
      ["channel"]=>
      string(10) "sfes_trace"
      ["datetime"]=>
      object(DateTime)#111 (3) {
        ["date"]=>
        string(26) "2019-08-03 12:53:10.802988"
        ["timezone_type"]=>
        int(3)
        ["timezone"]=>
        string(15) "Europe/Helsinki"
      }
      ["extra"]=>
      array(1) {
        ["backtrace"]=>
        NULL
      }
      ["formatted"]=>
      string(189) "[2019-08-03 12:53:10] sfes_trace.DEBUG: Response: {"response":{"acknowledged":true},"method":"DELETE","uri":"http://127.0.0.1/sineflow-esb-test-bar","HTTP code":200,"duration":0.026726} []
    "
    }
    

    Based on this information, I should be able to type in the terminal:

    curl -XDELETE 'http://127.0.0.1/sineflow-esb-test-bar?pretty=true'
    

    But of course this doesn't work, as it's trying to reach port 80, instead of 9200

    7.0 
    opened by pmishev 21
  • NoNodesAvailableException in StaticNoPingConnectionPool.php : No alive nodes found in your cluster

    NoNodesAvailableException in StaticNoPingConnectionPool.php : No alive nodes found in your cluster

    I use elasticsearch v 5.5.2 with laravel 5.3 - scout v -2.0. I a trying to executing below code but I am getting this error. NoNodesAvailableException.

    namespace App\Http\Controllers;
    
    use Illuminate\Http\Request;
    use Elasticsearch\ClientBuilder;
    use Elastica\Client as ElasticaClient;
    
    class clientController extends Controller
    {
        protected $elasticsearch;
        protected $elastica;
        public function __construct()
        {
            $this->elasticsearch = ClientBuilder::create()
                    //->setConnectionPool('\Elasticsearch\ConnectionPool\SniffingConnectionPool', [])
                    ->build();
            $elasticConfig=['host'=>"locahost",
                "port"=>9200,
                "index"=>'pets'];
            $this->elastica = new  ElasticaClient($elasticConfig);
        }
        public function elasticsearchTest(){
    
            $param = [
                'index' => 'pets',
                'type' => 'dog',
                'id'=>'1'
            ];
            $res = $this->elasticsearch->get($param);
            dump($res); 
        }
    }
    

    NoNodesAvailableException in StaticNoPingConnectionPool.php line 51: No alive nodes found in your cluster It's working fine in sense. Result:

    {
       "_index": "pets",
       "_type": "dog",
       "_id": "1",
       "_version": 1,
       "found": true,
       "_source": {
          "name": "tommy",
          "age": "3",
          "color": "black",
          "gender": "male"
       }
    }
    

    Also working on http://localhost:9200/pets/dog/1. Result:

    {"_index":"pets","_type":"dog","_id":"1","_version":1,"found":true,"_source":{
        "name":"tommy",
        "age":"3",
        "color":"black",
        "gender":"male"
    }
    }
    

    I also post this on stackover flow but no response.

    opened by manoj-infrasssist 21
  • Strange behaviour

    Strange behaviour

    I'm trying a simple get, everything works fine, but when I use Sense to run a PUT to update the document, if I try to retrieve the document via php I get an empty response.

    Is like it's not synced correctly.

    I'm I missing something here?

    Thanks!

    opened by manelet 21
  • Drop support for PHP 5.3?

    Drop support for PHP 5.3?

    PHP 5.3 was released six years ago, in June of 2009. It was EOL'd four months ago, in August 2014.

    Many popular PHP libraries, such as Guzzle, Drupal 8, Laravel, and Magento, have already migrated to PHP 5.4

    The change would introduce the usual bevy of bug fixes, performance enhancements, security fixes and new features (array shorthand and traits are most likely to be used by this project). But the biggest benefit would be fitting into the 5.4. ecosystem and being able to leverage projects like Guzzle4.

    Thoughts? How many people are still stuck on PHP 5.3 and unable to upgrade?

    question 2.0 breaking 
    opened by polyfractal 21
  • Search method returns NULL

    Search method returns NULL

    I'm having a puzzling problem with a website that uses Elasticsearchโ€”Elasticsearch is returning results to elasticsearch-php, which is then mysteriously failing to output them. This is with Elasticsearch v0.90.9, elasticsearch-php v0.4.5, and PHP v5.3.10. (Just in case, I've also tried elasticsearch-php v1.2.0, despite its incompatibility with pre-v1.0 Elasticsearch, which presented precisely the same problem.)

    When I directly query my Elasticsearch index, Elasticsearch happily returns the results. That's if I make the request via cURL. If I make the request via elasticsearch-php, Elasticsearch still returns the results, but they don't make it past elasticsearch-php.

    For example, here I search for a term that I know will return a small number of results (Jaquith, my last name) from my index (business) of a couple of million records:

    require 'vendor/autoload.php';
    $config['logging'] = TRUE;
    $client = new Elasticsearch\Client($config);
    $params['index'] = 'business';
    $params['body']['query']['match']['_all'] = 'Jaquith';
    $result = $client->search($params);
    var_dump($result);
    

    The output of var_dump($result) is NULL. Not false, but NULL. If I I deliberately specify invalid options, such as an invalid index (e.g., $params['index'] = 'fake_index'), then it returns false, so it's not like it can only return NULL.

    Where things get weird is when looking at elasticsearch.log. Here is what's logged from the execution of the above:

    [2014-08-04 21:34:13] log.DEBUG: Request Body ["{\"query\":{\"match\":{\"_all\":\"Jaquith\"}}}"] {"file":"/vol/www/business.openva.com/htdocs/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/AbstractConnection.php","line":113,"class":"Elasticsearch\\Connections\\AbstractConnection","function":"logRequestSuccess"}
    [2014-08-04 21:34:13] log.INFO: Request Success: {"method":"POST","uri":"http://localhost:9200/business/_search","headers":{"host":["localhost:9200"],"user-agent":["Guzzle/3.9.1 curl/7.22.0 PHP/5.3.10-1ubuntu3.13"],"content-length":[38]},"HTTP code":200,"duration":0.009757} {"file":"/vol/www/business.openva.com/htdocs/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/AbstractConnection.php","line":123,"class":"Elasticsearch\\Connections\\AbstractConnection","function":"logRequestSuccess"}
    [2014-08-04 21:34:13] log.DEBUG: Response ["{\"took\":7,\"timed_out\":false,\"_shards\":{\"total\":5,\"successful\":5,\"failed\":0},\"hits\":{\"total\":4,\"max_score\":6.5482264,\"hits\":[{\"_index\":\"business\",\"_type\":\"5\",\"_id\":\"ZTU0BFYcSIWQWZYdCaNS1g\",\"_score\":6.5482264, \"_source\" : {\"first_name\": \"MARY\", \"last_name\": \"JAQUITH\", \"middle_name\": \"\", \"id\": \"0562703\", \"title\": \"PRESIDENT\"},},{\"_index\":\"business\",\"_type\":\"5\",\"_id\":\"L9PNiEdUSGmbZAq1bgPjQQ\",\"_score\":4.9117994, \"_source\" : {\"first_name\": \"MARY\", \"last_name\": \"JAQUITH\", \"middle_name\": \"T\", \"id\": \"0562703\", \"title\": \"S/T\"},},{\"_index\":\"business\",\"_type\":\"9\",\"_id\":\"C7Web8w6T0S1zhyUtbjaAw\",\"_score\":2.0459418, \"_source\" : {\"expiration-date\": null, \"agent-state\": \"VA\", \"agent_status\": \"1\", \"agent_court_locality\": \"LOUDOUN COUNTY\", \"state-formed\": \"VIRGINIA\", \"id\": \"S496907\", \"agent-name\": \"NATALIE ANDERSON JAQUITH\", \"city\": \"Sterling\", \"zip\": \"20164\", \"state\": \"VA\", \"agent-city\": \"STERLING\", \"status\": \"ACTIVE\", \"agent_zip\": \"20164\", \"street-2\": \"\", \"street-1\": \"206 Laura Anne Drive\", \"date\": \"2014-03-17\", \"agent-street-1\": \"206 LAURA ANNE DRIVE\", \"agent_date\": \"2014-03-17\", \"name\": \"Happy Little Paintings, LLC\", \"agent-street-2\": \"\", \"industry\": \"00\", \"status-date\": \"2014-03-17\", \"address-date\": null},},{\"_index\":\"business\",\"_type\":\"2\",\"_id\":\"0LYakZfaTaKj4lGxaF0hGw\",\"_score\":1.6373172, \"_source\" : {\"agent_name\": \"MARY G JAQUITH\", \"address_date\": null, \"stock_ind\": \"S\", \"agent_status\": \"OFFICER\", \"agent_court_locality\": \"VIRGINIA BEACH CITY\", \"total_shares\": \"00000005000\", \"incorporation_date\": \"2001-08-02\", \"stock_class\": \"00000000\", \"id\": \"0562703\", \"city\": \"VA BEACH\", \"zip\": \"23457\", \"state\": \"VA\", \"assessment\": \"NORMAL ASSESSMENT\", \"merged\": \"\", \"state_formed\": \"VIRGINIA\", \"status\": \"ACTIVE\", \"agent_zip\": \"23457\", \"agent_city\": \"VIRGINIA BEACH\", \"status_date\": \"2009-03-10\", \"street_1\": \"4166 CHARITY NECK ROAD\", \"street_2\": \"\", \"agent_date\": \"2013-04-29\", \"name\": \"CORNERSTONE FARMS, LTD.\", \"expiration_date\": null, \"industry\": \"GENERAL\", \"agent_street_1\": \"4166 CHARITY NECK RD.\", \"agent_street_2\": \"\", \"number_shares\": \"00000000000\", \"agent_state\": \"VA\"},}]}}"] {"file":"/vol/www/business.openva.com/htdocs/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/AbstractConnection.php","line":124,"class":"Elasticsearch\\Connections\\AbstractConnection","function":"logRequestSuccess"}
    [2014-08-04 21:34:13] trace.INFO: curl -XPOST 'http://localhost:9200/business/_search?pretty=true' -d '{"query":{"match":{"_all":"Jaquith"}}}' [] []
    [2014-08-04 21:34:13] trace.DEBUG: Response: {"response":"{\"took\":7,\"timed_out\":false,\"_shards\":{\"total\":5,\"successful\":5,\"failed\":0},\"hits\":{\"total\":4,\"max_score\":6.5482264,\"hits\":[{\"_index\":\"business\",\"_type\":\"5\",\"_id\":\"ZTU0BFYcSIWQWZYdCaNS1g\",\"_score\":6.5482264, \"_source\" : {\"first_name\": \"MARY\", \"last_name\": \"JAQUITH\", \"middle_name\": \"\", \"id\": \"0562703\", \"title\": \"PRESIDENT\"},},{\"_index\":\"business\",\"_type\":\"5\",\"_id\":\"L9PNiEdUSGmbZAq1bgPjQQ\",\"_score\":4.9117994, \"_source\" : {\"first_name\": \"MARY\", \"last_name\": \"JAQUITH\", \"middle_name\": \"T\", \"id\": \"0562703\", \"title\": \"S/T\"},},{\"_index\":\"business\",\"_type\":\"9\",\"_id\":\"C7Web8w6T0S1zhyUtbjaAw\",\"_score\":2.0459418, \"_source\" : {\"expiration-date\": null, \"agent-state\": \"VA\", \"agent_status\": \"1\", \"agent_court_locality\": \"LOUDOUN COUNTY\", \"state-formed\": \"VIRGINIA\", \"id\": \"S496907\", \"agent-name\": \"NATALIE ANDERSON JAQUITH\", \"city\": \"Sterling\", \"zip\": \"20164\", \"state\": \"VA\", \"agent-city\": \"STERLING\", \"status\": \"ACTIVE\", \"agent_zip\": \"20164\", \"street-2\": \"\", \"street-1\": \"206 Laura Anne Drive\", \"date\": \"2014-03-17\", \"agent-street-1\": \"206 LAURA ANNE DRIVE\", \"agent_date\": \"2014-03-17\", \"name\": \"Happy Little Paintings, LLC\", \"agent-street-2\": \"\", \"industry\": \"00\", \"status-date\": \"2014-03-17\", \"address-date\": null},},{\"_index\":\"business\",\"_type\":\"2\",\"_id\":\"0LYakZfaTaKj4lGxaF0hGw\",\"_score\":1.6373172, \"_source\" : {\"agent_name\": \"MARY G JAQUITH\", \"address_date\": null, \"stock_ind\": \"S\", \"agent_status\": \"OFFICER\", \"agent_court_locality\": \"VIRGINIA BEACH CITY\", \"total_shares\": \"00000005000\", \"incorporation_date\": \"2001-08-02\", \"stock_class\": \"00000000\", \"id\": \"0562703\", \"city\": \"VA BEACH\", \"zip\": \"23457\", \"state\": \"VA\", \"assessment\": \"NORMAL ASSESSMENT\", \"merged\": \"\", \"state_formed\": \"VIRGINIA\", \"status\": \"ACTIVE\", \"agent_zip\": \"23457\", \"agent_city\": \"VIRGINIA BEACH\", \"status_date\": \"2009-03-10\", \"street_1\": \"4166 CHARITY NECK ROAD\", \"street_2\": \"\", \"agent_date\": \"2013-04-29\", \"name\": \"CORNERSTONE FARMS, LTD.\", \"expiration_date\": null, \"industry\": \"GENERAL\", \"agent_street_1\": \"4166 CHARITY NECK RD.\", \"agent_street_2\": \"\", \"number_shares\": \"00000000000\", \"agent_state\": \"VA\"},}]}}","method":"POST","uri":"http://localhost:9200/business/_search","HTTP code":200,"duration":0.009757} []
    

    Elasticsearch returns results just fine. Somewhere between elasticsearch-php receiving that JSON and returning the content as PHP it's becoming, simply, NULL.

    There's a non-trivial chance that I'm doing something stupid here, but I can't figure out what it is. Any ideas of what's going on?

    opened by waldoj 19
  • SSL cert error

    SSL cert error

    I am receiving the following error when trying to use the DELETE API.

    Elasticsearch\\Common\\Exceptions\\TransportException","message":"SSL certificate problem: self signed certificate in certificate chain","file":"\pathto\/vendor\/elasticsearch\/elasticsearch\/src\/Elasticsearch\/Connections\/AbstractConnection.php","line":312

    in my config file I am setting the verification to false. this is working for everything except delete.

    update: I have done some research and it seems that the curl_opt - CURLOPT_SSL_VERIFYPEER is not getting set to false, is there a way to pass this using a config file to the elastic search client?

    opened by warroyo 19
  • PHP Version Support

    PHP Version Support

    Hello!

    I'd like to request an update/clarification to https://github.com/elastic/elasticsearch-php#php-version-requirement about the PHP versions supported.

    Screenshot 2020-12-01 at 13 20 21

    The table doesn't use semver (and it shouldn't necessarily), but >= 7.0.0 and >= 7.1.0 would suggest to me that ES-PHP 6.0 and 7.0 technically support PHP 8.0, (which is obviously out now as a stable release!) but it doesn't, and can be confirmed by looking at https://github.com/elastic/elasticsearch-php/blob/6.x/composer.json#L16 which as ^7.0 and https://github.com/elastic/elasticsearch-php/blob/7.x/composer.json#L16 which has ^7.1. And ^7.0 basically means >=7.0.0 <8.0.0 etc.

    Anything we can do for clarification? As I'm sure there are going to be people coming along and thinking PHP 8 should work...

    Thanks!

    opened by reedy 17
  • Need to unset http proxy

    Need to unset http proxy

    Summary of problem or feature request

    While requesting I have to unset http proxy, but how to set it during build? I need to call this way.

    Code snippet of problem

    ClientBuilder::create()
                    ->setHosts(["{$conf['host']}:{$conf['port']}"])
                    ->build()
    

    System details

    • RedHat
    • PHP 7.2
    • Client 7.17
    • Elasticsearch 7.16.3
    opened by abmmhasan 0
  • Typo in NodePool documentation about SimpleNodePool

    Typo in NodePool documentation about SimpleNodePool

    Summary of problem or feature request

    The NodePool documentation has a typo. (SimpleNodePool constructor takes a SelectorInterface as first argument)

    Code snippet of problem

    use Elastic\Transport\NodePool\Resurrect\ElasticsearchResurrect;
    use Elastic\Transport\NodePool\Selector\RoundRobin;
    use Elastic\Transport\NodePool\SimpleNodePool;
    
    $nodePool = new SimpleNodePool(
        new SimpleNodePool(),
        new ElasticsearchResurrect()
    );
    

    instead of

    $nodePool = new SimpleNodePool(
        new RoundRobin(),
        new ElasticsearchResurrect()
    );
    

    System details

    • ES-PHP client version : 8.5
    opened by fgravelaine 0
  • The array structure of a batch index is confusing

    The array structure of a batch index is confusing

    That's what the official document says: Bulk indexing with PHP arrays.

    for($i = 0; $i < 100; $i++) {
        $params['body'][] = [
            'index' => [
                '_index' => 'my_index',
    	    ]
        ];
    
        $params['body'][] = [
            'my_field'     => 'my_value',
            'second_field' => 'some more values'
        ];
    }
    
    $responses = $client->bulk($params);
    

    The above array structure is confusing, so why not do it:

    for($i = 0; $i < 100; $i++) {
        $params[] = [
            'index' => [
                '_index' => 'my_index',
                '_id' => $i
    	    ],
           'body' => [
            'my_field'     => 'my_value',
            'second_field' => 'some more values'
           ]
        ];
    }
    
    $responses = $client->bulk($params);
    
    • Operating System win10
    • PHP Version 8
    • ES-PHP client version lasted
    • Elasticsearch version 8
    question 
    opened by rory5515 1
  • PHP 8.2 compatibility in Elasticsearch PHP client version 7

    PHP 8.2 compatibility in Elasticsearch PHP client version 7

    Summary of problem or feature request

    Elasticsearch PHP client claims it is compatible with PHP 8.2:

    https://github.com/elastic/elasticsearch-php/blob/1890f9d7fde076b5a3ddcf579a802af05b2e781b/composer.json#L19

    When installing elasticsearch/elasticsearch:^7.0 running PHP 8.2.0RC2 and making some requests, I get the following deprecation warning:

    Deprecated: Creation of dynamic property GuzzleHttp\Ring\Client\CurlMultiHandler::$_mh is deprecated in /tmp/scout_elastic_test/vendor/ezimuel/ringphp/src/Client/CurlMultiHandler.php on line 47
    

    I have submitted an upstream patch ezimuel/ringphp#7 which should fix the above, but I'm not sure if it has been noticed yet.

    From my basic checks, it otherwise seems compatible.

    Code snippet of problem

    Our full test for ES7 compatibility is here.

    $client = \Elasticsearch\ClientBuilder::create()->build();
    
    $client->index(['index' => 'my_index', 'id' => 'my_id', 'body' => ['testField' => 'abc']]);
    $client->get(['index' => 'my_index', 'id' => 'my_id']);
    $client->search(['index' => 'my_index', 'body' => ['query' => ['match' => ['testField' => 'abc']]]]);
    $client->delete(['index' => 'my_index', 'id' => 'my_id']);
    

    System details

    • Operating System - Linux
    • PHP Version - 8.2.0RC2
    • ES-PHP client version - 7.17.0
    • Elasticsearch version - 8.1.2
    opened by asgrim 2
  • Add return types to MessageResponseTrait to match upcoming PSR interface

    Add return types to MessageResponseTrait to match upcoming PSR interface

    I was getting several deprecations notices so I added the return types that will be added to the PSR interfaces we use.

    For completeness here are the messages:

    User Deprecated: Method "ArrayAccess::offsetGet()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Elastic\Elasticsearch\Response\Elasticsearch" now to avoid errors or add an explicit @return annotation to suppress this message.
    
    User Deprecated: Method "Psr\Http\Message\MessageInterface::getProtocolVersion()" might add "string" as a native return type declaration in the future. Do the same in implementation "Elastic\Elasticsearch\Response\Elasticsearch" now to avoid errors or add an explicit @return annotation to suppress this message.
    
    User Deprecated: Method "Psr\Http\Message\MessageInterface::withProtocolVersion()" might add "static" as a native return type declaration in the future. Do the same in implementation "Elastic\Elasticsearch\Response\Elasticsearch" now to avoid errors or add an explicit @return annotation to suppress this message.
    
    User Deprecated: Method "Psr\Http\Message\MessageInterface::getHeaders()" might add "array" as a native return type declaration in the future. Do the same in implementation "Elastic\Elasticsearch\Response\Elasticsearch" now to avoid errors or add an explicit @return annotation to suppress this message.
    
    User Deprecated: Method "Psr\Http\Message\MessageInterface::hasHeader()" might add "bool" as a native return type declaration in the future. Do the same in implementation "Elastic\Elasticsearch\Response\Elasticsearch" now to avoid errors or add an explicit @return annotation to suppress this message.
    
    User Deprecated: Method "Psr\Http\Message\MessageInterface::getHeader()" might add "array" as a native return type declaration in the future. Do the same in implementation "Elastic\Elasticsearch\Response\Elasticsearch" now to avoid errors or add an explicit @return annotation to suppress this message.
    
    User Deprecated: Method "Psr\Http\Message\MessageInterface::getHeaderLine()" might add "string" as a native return type declaration in the future. Do the same in implementation "Elastic\Elasticsearch\Response\Elasticsearch" now to avoid errors or add an explicit @return annotation to suppress this message.
    
    User Deprecated: Method "Psr\Http\Message\MessageInterface::withHeader()" might add "static" as a native return type declaration in the future. Do the same in implementation "Elastic\Elasticsearch\Response\Elasticsearch" now to avoid errors or add an explicit @return annotation to suppress this message.
    
    User Deprecated: Method "Psr\Http\Message\MessageInterface::withAddedHeader()" might add "static" as a native return type declaration in the future. Do the same in implementation "Elastic\Elasticsearch\Response\Elasticsearch" now to avoid errors or add an explicit @return annotation to suppress this message.
    
    User Deprecated: Method "Psr\Http\Message\MessageInterface::withoutHeader()" might add "static" as a native return type declaration in the future. Do the same in implementation "Elastic\Elasticsearch\Response\Elasticsearch" now to avoid errors or add an explicit @return annotation to suppress this message.
    
    User Deprecated: Method "Psr\Http\Message\MessageInterface::getBody()" might add "StreamInterface" as a native return type declaration in the future. Do the same in implementation "Elastic\Elasticsearch\Response\Elasticsearch" now to avoid errors or add an explicit @return annotation to suppress this message.
    
    User Deprecated: Method "Psr\Http\Message\MessageInterface::withBody()" might add "static" as a native return type declaration in the future. Do the same in implementation "Elastic\Elasticsearch\Response\Elasticsearch" now to avoid errors or add an explicit @return annotation to suppress this message.
    
    User Deprecated: Method "Psr\Http\Message\ResponseInterface::getStatusCode()" might add "int" as a native return type declaration in the future. Do the same in implementation "Elastic\Elasticsearch\Response\Elasticsearch" now to avoid errors or add an explicit @return annotation to suppress this message.
    
    User Deprecated: Method "Psr\Http\Message\ResponseInterface::withStatus()" might add "static" as a native return type declaration in the future. Do the same in implementation "Elastic\Elasticsearch\Response\Elasticsearch" now to avoid errors or add an explicit @return annotation to suppress this message.
    
    User Deprecated: Method "Psr\Http\Message\ResponseInterface::getReasonPhrase()" might add "string" as a native return type declaration in the future. Do the same in implementation "Elastic\Elasticsearch\Response\Elasticsearch" now to avoid errors or add an explicit @return annotation to suppress this message.
    
    opened by hacfi 5
Releases(v8.5.0)
  • v8.5.0(Nov 2, 2022)

    This release is compatible with the latest Elasticsearch 8.5.0.

    General changes

    This release introduces 1 experimental new API and 2 stable APIs.

    Specific changes per endpoints

    Indices.downsample (new EXPERIMENTAL API)

    API: https://github.com/elastic/elasticsearch/blob/8.5/rest-api-spec/src/main/resources/rest-api-spec/api/indices.downsample.json Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-rollup.html

    Ml.clearTrainedModelDeploymentCache (new API)

    API: https://github.com/elastic/elasticsearch/blob/8.5/rest-api-spec/src/main/resources/rest-api-spec/api/ml.clear_trained_model_deployment_cache.json Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/master/clear-trained-model-deployment-cache.html

    Ml.inferTrainedModel

    This API is now stable.

    Ml.putTrainedModelDefinitionPart

    This API is now stable.

    Ml.putTrainedModelVocabulary

    This API is now stable.

    Ml.startTrainedModelDeployment

    This API is now stable. The descript of the number_of_allocations has been changed in "The total number of allocations this model is assigned across machine learning nodes".

    Ml.stopTrainedModelDeployment

    This API is now stable.

    Rollup.rollup

    This experimental API has been removed.

    Security.activateUserProfile

    This API is now stable.

    Security.bulkUpdateApiKeys (new API)

    API: https://github.com/elastic/elasticsearch/blob/8.5/rest-api-spec/src/main/resources/rest-api-spec/api/security.bulk_update_api_keys.json Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-update-api-keys.html

    Security.disableUserProfile

    This API is now stable.

    Security.enableUserProfile

    This API is now stable.

    Security.getApiKey

    Added the with_limited_by boolean parameter. Flag to show the limited-by role descriptors of API Keys.

    Security.getUser

    Added the with_profile_uid boolean parameter. Flag to retrieve profile uid (if exists) associated to the user.

    Security.getUserProfile

    This API is now stable. Changed the description of uid parameter, a comma-separated list of unique identifier for user profiles.

    Security.hasPrivilegesUserProfile

    This API is now stable.

    Security.queryApiKeys

    Added the with_limited_by boolean parameter. Flag to show the limited-by role descriptors of API Keys.

    Security.suggestUserProfiles

    This API is now stable.

    Security.updateUserProfileData

    This API is now stable.

    TextStructure.findStructure

    Added the ecs_compatibility string parameter. Optional parameter to specify the compatibility mode with ECS Grok patterns - may be either 'v1' or 'disabled'.

    Source code(tar.gz)
    Source code(zip)
  • v7.17.1(Sep 30, 2022)

  • v8.4.0(Aug 24, 2022)

    This release is compatible with the latest Elasticsearch 8.4.0 and includes the following changes:

    • Added a ClientInterface to simplify the mock of the Client, this is a fix for #1227 #1249
    • Added the support of Symfony HTTP client, fixing the issue #1241 #1243
    • Added the API compatibility header #1233

    Added the following new API ๐ŸŽ‰

    Stable

    API changes

    get

    Added the force_synthetic_source parameter (boolean). Should this request force synthetic _source? Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. Fetches with this enabled will be slower the enabling synthetic source natively in the index.

    mget

    Added the force_synthetic_source parameter (boolean). Should this request force synthetic _source? Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. Fetches with this enabled will be slower the enabling synthetic source natively in the index.

    search

    Added the force_synthetic_source parameter (boolean). Should this request force synthetic _source? Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. Fetches with this enabled will be slower the enabling synthetic source natively in the index.

    Ml.startTrainedModelDeployment

    Added cache_size parameter (string). A byte-size value for configuring the inference cache size. For example, 20mb.

    Snapshot.get

    Added the following parameters:

    • sort (enum), allows setting a sort order for the result. Defaults to start_time;
    • size (integer), maximum number of snapshots to return. Defaults to 0 which means return all that match without limit;
    • order (enum), soprt order;
    • from_sort_value (string), value of the current sort column at which to start retrieval;
    • after (string), offset identifier to start pagination from as returned by the 'next' field in the response body;
    • offset (integer), numeric offset to start pagination based on the snapshots matching the request. Defaults to 0;
    • slm_policy_filter (string), filter snapshots by a comma-separated list of SLM policy names that snapshots belong to. Accepts wildcards. Use the special pattern '_none' to match snapshots without an SLM policy.
    Source code(tar.gz)
    Source code(zip)
  • v8.3.0(Jun 28, 2022)

    This release is compatible with the latest Elasticsearch 8.3.0.

    Added the following new API ๐ŸŽ‰

    Experimental

    API changes

    Cluster.deleteVotingConfigExclusions

    Added master_timeout parameter (time). Timeout for submitting request to master.

    Cluster.postVotingConfigExclusions

    Added master_timeout parameter (time). Timeout for submitting request to master.

    Ml.inferTrainedModel (renamed)

    The Ml.inferTrainedModelDeployment API has been renamed in Ml.inferTrainedModel.

    Ml.previewDatafeed

    Added the following optional parameters:

    • start: string, the start time from where the datafeed preview should begin;
    • end: string, the end time when the datafeed preview should stop.

    Ml.startTrainedModelDeployment

    Added the following optional parameters:

    • number_of_allocations: int, the number of model allocations on each node where the model is deployed;
    • threads_per_allocation: int, the number of threads used by each model allocation during inference;
    • queue_capacity: int, controls how many inference requests are allowed in the queue at a time.

    Snapshot.get

    Added the index_names parameter (boolean). Whether to include the name of each index in the snapshot. Defaults to true.

    Source code(tar.gz)
    Source code(zip)
  • v8.2.1(May 25, 2022)

  • v8.2.0(May 4, 2022)

    This release is compatible with the latest Elasticsearch 8.2.0.

    This release includes the following fixes:

    • Added the array support for text/plain #1220

    Added the following new APIs ๐ŸŽ‰ (2 stable and 6 experimental)

    Stable

    Experimental

    Source code(tar.gz)
    Source code(zip)
  • v8.1.0(Apr 19, 2022)

    This release is compatible with the latest Elasticsearch 8.1.0.

    Added the following new APIs ๐ŸŽ‰ (4 stable)

    API changes

    Indices.forcemerge

    Added wait_for_completion parameter.

    Indices.get

    Added features enum parameter, return only information on specified index features.

    Ml.deleteTrainedModel

    Added force boolean parameter, true if the model should be forcefully deleted.

    Source code(tar.gz)
    Source code(zip)
  • v8.0.1(Mar 30, 2022)

    This release contains the following fix:

    • use of NoNodeAvailableException exception in endpoints, fixing https://github.com/elastic/elasticsearch-php/issues/1209 with e7d448d
    Source code(tar.gz)
    Source code(zip)
  • v8.0.0(Mar 24, 2022)

    Finally 8.0.0 for Elasticsearch 8.0 is GA!!! :partying_face:

    This new major version of elasticsearch-php contains a brand new implementation compared with 7.x. It supports PSR-7 for HTTP messages and PSR-18 for HTTP client communications. We used the elastic-transport-php library for HTTP communications.

    We tried to reduce the BC breaks as much as possible with 7.x but there are some (big) differences:

    • we changed the namespace, now everything is under Elastic\Elasticsearch;
    • we changed the Exception model, using the namespace Elastic\Elasticsearch\Exception. All the exceptions extends the ElasticsearchException interface, as in 7.x;
    • we changed the response type of each endpoints using an Elasticsearch response class. This class wraps a a PSR-7 response allowing the access of the body response as array or object. This means you can access the API response as in 7.x, no BC break here! :angel:

    You can have a look at the BREAKING_CHANGES file for more information.

    We are still working on the new documentation for 8.0, in the meantime you can have a look at the README where we reported a quick start guide.

    Source code(tar.gz)
    Source code(zip)
  • v8.0.0-rc2(Mar 9, 2022)

  • v8.0.0-rc1(Mar 6, 2022)

  • v8.0.0-alpha(Mar 2, 2022)

    This is an alpha release of 8.0.0. This new major version of elasticsearch-php contains a brand new implementation compared with 7.x. It supports PSR-7 for HTTP messages and PSR-18 for HTTP client communications. We used the elastic-transport-php library for HTTP communications.

    We tried to reduce the BC breaks as much as possible with 7.x but there are some (big) differences:

    • we changed the namespace, now everything is under Elastic\Elasticsearch;
    • we changed the Exception model, using the namespace Elastic\Elasticsearch\Exception. All the exceptions extends the ElasticsearchException interface, as in 7.x;
    • we changed the response type of each endpoints using an Elasticsearch response class. This class wraps a a PSR-7 response allowing the access of the body response as array or object. This means you can access the API response as in 7.x, no BC break here! :angel:

    You can have a look at the BREAKING_CHANGES file for more information.

    We are still working on the new documentation for 8.0, in the meantime you can have a look at the README where we reported a quick start guide.

    Source code(tar.gz)
    Source code(zip)
  • v7.17.0(Feb 3, 2022)

    This release is compatible with the latest Elasticsearch 7.17.0 released the 1st February 2022.

    It includes the following fixes and improvements:

    • Allow psr/log v3 #1184

    Added the following new APIs ๐ŸŽ‰ (1 stable):

    API changes

    • Ml.forecast, added body for HTTP request where query parameters can be specified in the body
    • Ml.openJob, added body for HTTP request where query parameters can be specified in the body
    • Transform.deleteTransform, added the timeout parameter, (time) controls the time to wait for the transform deletion
    • Transform.previewTransform, added the timeout parameter, (time) Controls the time to wait for the preview
    • Transform.putTransform, added the timeout parameter, (time) Controls the time to wait for the transform to start
    • Transform.updateTransform, added the timeout parameter, (time) Controls the time to wait for the update
    • Transform.upgradeTransforms, added the timeout parameter, (time) Controls the time to wait for the upgrade
    Source code(tar.gz)
    Source code(zip)
  • v7.16.0(Dec 9, 2021)

    This release is compatible with PHP 8.1 (thanks to @karyna-tsymbal-atwix) and the latest Elasticsearch 7.16.0 released in 7th December 2021.

    It includes the following fixes and improvements:

    • Added support of includePortInHostHeader in ClientBuilder::fromConfig #1181
    • Fixed UTF-16 issue in SmartSerializer with single unpaired surrogate in unicode escape #1179
    • Replace trait with abstract class to avoid Deprecated Functionality issue in PHP 8.1 #1175

    Added the following new APIs ๐ŸŽ‰ (4 stable, and 2 experimental):

    Stable

    Experimental

    API changes

    • deleteByQuery, removed _source, _source_excludes, _source_includes parameters
    • openPointInTime, the parameter keep_alive is now required. Changed the index parameter to be required (was optional)
    • Nodes.stats, added the shards option to the index_metric parameter
    • searchMvt, added the track_total_hits (boolean|long) parameter. Indicate if the number of documents that match the query should be tracked. A number can also be specified, to accurately track the total hit count up to the number
    • termsEnum, this API is now stable
    • updateByQuery, removed _source, _source_excludes, _source_includes parameters
    • Fleet.globalCheckpoints, this API is now stable
    • Indices.getIndexTeamplate, changed the name parameter as string. A pattern that returned template names must match
    • Ingest.putPipeline, added the if_version parameter (int). Required version for optimistic concurrency control for pipeline updates
    • Ml.putTrainedModel, added the defer_definition_decompression parameter. (boolean) If set to true and a compressed_definition is provided, the request defers definition decompression and skips relevant validations. (Default = false)
    • Monitoring.bulk, this API is now stable
    • Nodes.hotThreads, added the sort parameter (enum). The sort order for 'cpu' type (default: total) (Options = cpu,total)
    • Nodes.info, changed the description of metric parameter (list). A comma-separated list of metrics you wish returned. Use _all to retrieve all metrics and _none to retrieve the node identity without any additional metrics
    • SearchableSnapshots.mount, this API is now stable
    • SearchableSnapshots.stats, this API is now stable
    • Security.clearCachedServiceTokens, this API is now stable
    • Security.createServiceToken, this API is now stable
    • Security.deleteServiceToken, this API is now stable
    • Security.getServiceAccounts, this API is now stable
    • Security.getServiceCredentials, this API is now stable
    • Shutdown.deleteNode, this API is now stable
    • Shutdown.getNode, this API is now stable
    • Shutdown.putNode, this API is now stable
    • Transform.deleteTransform, added the timeout parameter (time). Controls the time to wait for the transform deletion
    • Transform.previewTransform, added the transform_id parameter (string), The id of the transform to preview. Added the timeout parameter (time). Controls the time to wait for the preview
    • Transform.putTransform, added the timeout parameter (time). Controls the time to wait for the transform to start
    • Transform.updateTransform, added the timeout parameter (time). Controls the time to wait for the update
    Source code(tar.gz)
    Source code(zip)
  • v7.15.0(Sep 23, 2021)

    This release is compatible with the latest Elasticsearch 7.15.0 released in 22nd September 2021.

    Added the following new APIs ๐ŸŽ‰ (1 stable and 5 experimental):

    Stable

    Experimental

    API changes

    Ml.putJob

    Added the ignore_unavailable parameter, (boolean) to ignore unavailable indexes (default: false)

    Added the allow_no_indices parameter, (boolean) to ignore if the source indices expressions resolves to no concrete indices (default: true)

    Added the ignore_throttled parameter, (boolean) to ignore indices that are marked as throttled (default: true). Only set if datafeed_config is provided

    Added the expand_wildcards parameter, (enum) whether source index expressions should get expanded to open or closed indices

    Nodes.stats

    Added the shards option to the index_metric parameter

    OpenPointInTime

    Changed the index parameter to be required (was optional)

    Source code(tar.gz)
    Source code(zip)
  • v7.14.0(Aug 3, 2021)

    This release is compatible with the latest Elasticsearch 7.14.0 released in 3rd August 2021.

    It includes the following fixes and improvements:

    • Usage of psr/log version 2 #1154
    • Update search iterators to send scroll_id inside the request body #1134
    • Added the ingest.geoip.downloader.enabled=false setting for ES 5867351
    • Removed phpcs for autogenerated files (endpoints) 651c57b

    Added the following new APIs ๐ŸŽ‰ (8 stable, and 1 beta):

    Stable

    Beta

    API changes

    • Msearch, removed the query_and_fetch and dfs_query_and_fetch options in search_type parameter.
    • MsearchTemplate, removed the query_and_fetch and dfs_query_and_fetch options in search_type parameter.
    • SearchTemplate, removed the query_and_fetch and dfs_query_and_fetch options in search_type parameter.
    • Snapshot.get, added include_repository parameter, (boolean) whether to include the repository name in the snapshot info. Defaults to true.
    • Snapshot.repositoryAnalyze, added rarely_abort_writes parameter, (boolean) whether to rarely abort writes before they complete. Defaults to 'true'.
    Source code(tar.gz)
    Source code(zip)
  • v6.8.2(Jul 14, 2021)

    • Fix #1131 class naming for some endpoints used in elasticsearch-php < 6.8. These endpoints are: NodeAttrs, ForceMerge, MTermVectors, TermVectors (https://github.com/elastic/elasticsearch-php/pull/1151)
    Source code(tar.gz)
    Source code(zip)
  • v7.13.1(Jun 15, 2021)

  • v7.13.0(May 25, 2021)

    This release is compatible with the latest Elasticsearch 7.13.0 released in 25th May 2021.

    It includes the following fixes and improvements:

    • (DOCS) Added the HTTP meta data section #1143
    • Added support for API Compatibility Header #1142
    • (DOCS) Added Helpers section to PHP book #1129
    • Added the API description in phpdoc section for each endpoint 9e05c81
    • Usage of PHPUnit 9 only + migrated xml configurations 038b5dd

    Added the following new APIs ๐ŸŽ‰ (4 stable, 7 experimental, and 5 beta):

    Stable

    Experimental

    Beta

    API changes

    • Cat.nodes, added the include_unloaded_segments parameter (boolean). If set to true segment stats will include stats for segments that are not currently loaded into memory (Default = false).
    • Ml.deleteDataFrameAnalytics, this API is now stable, previosuly it was beta.
    • Ml.deleteTrainedModel, this API is now stable, previosuly it was beta.
    • Ml.explainDataFrameAnalytics, this API is now stable, previosuly it was beta.
    • Ml.getDataFrameAnalytics, this API is now stable, previosuly it was beta.
    • Ml.getDataFrameAnalyticsStats, this API is now stable, previosuly it was beta.
    • Ml.getTrainedModels, this API is now stable, previosuly it was beta.
    • Ml.getTrainedModelsStats, this API is now stable, previosuly it was beta.
    • Ml.putDataFrameAnalytics, this API is now stable, previosuly it was beta.
    • Ml.putTrainedModel, this API is now stable, previosuly it was beta.
    • Ml.startDataFrameAnalytics, this API is now stable, previosuly it was beta.
    • Ml.stopDataFrameAnalytics, this API is now stable, previosuly it was beta.
    • Ml.updateDataFrameAnalytics, this API is now stable, previosuly it was beta.
    • Nodes.stats, added include_unloaded_segments parameter (boolean). If set to true segment stats will include stats for segments that are not currently loaded into memory (Default = false).
    • Snapshot.get, added index_details parameter (boolean). Whether to include details of each index in the snapshot, if those details are available. Defaults to false.
    • TextStructure.findStructure, this API is now stable, previosuly it was experimental.
    Source code(tar.gz)
    Source code(zip)
  • v7.12.0(Mar 23, 2021)

    This release is compatible with the latest Elasticsearch 7.12.0 released in 23th March 2021.

    It includes the following fixes and improvements:

    • 136d5b9 Removed cpliakas/git-wrapper in favor of symplify/git-wrapper
    • 0d81be1 Fixed warning header as array in YAML tests generator
    • f69d96f Refactored TEST_SUITE with free, platinum + removed old YamlRunnerTest

    Added the following new APIs ๐ŸŽ‰ (5 stable, 1 experimental):

    Stable

    Experimental

    API changes

    • Autoscaling.deleteAutoscalingPolicy, this API is now stable, previosuly it was experimental
    • Autoscaling.getAutoscalingPolicy, this API is now stable, previosuly it was experimental
    • Autoscaling.putAutoscalingPolicy, this API is now stable, previosuly it was experimental
    • Indices.close, added documentation for the wait_for_active_shards parameter: set to index-setting to wait according to the index setting index.write.wait_for_active_shards, or all to wait for all shards, or an integer. Defaults to 0
    • Ml.findFileStructure, this API has been removed, previosuly it was experimental
    • Search, added the min_compatible_shard_node parameter (string). The minimum compatible version that all shards involved in search should have for this request to be successful
    • SearchableSnapshots.mount, added the storage parameter (string). Selects the kind of local storage used to accelerate searches. Experimental, and defaults to full_copy
    • SearchableSnapshots.stats, added the level parameter (enum). Return stats aggregated at cluster, index or shard level (Options = cluster,indices,shards) (Default = indices)
    Source code(tar.gz)
    Source code(zip)
  • v6.8.1(Mar 22, 2021)

    • Fixed missing class aliases in 6.8.0 (https://github.com/elastic/elasticsearch-php/pull/1114)
    • Backported #1066: fix #1058 using object instead of array in onFailure event (https://github.com/elastic/elasticsearch-php/pull/1109)
    Source code(tar.gz)
    Source code(zip)
  • v6.8.0(Mar 1, 2021)

    The 6.8.0 release includes all the Elasticsearch endpoints (including XPack). We tested using the latest Elasticsearch 6.8.14 released in February 10, 2021.

    NOTE: This release requires PHP 7.3+. It supports also PHP 8.

    This release includes the following updates:

    • Added the XPack endpoints
    • Removed Travis CI in favor of Github Action

    and backported the following features/PRs:

    • Added X-Opaque-Id header (https://github.com/elastic/elasticsearch-php/pull/952)
    • Added X-Elastic-Client-Meta header (https://github.com/elastic/elasticsearch-php/pull/1089)
    • Added the license header (https://github.com/elastic/elasticsearch-php/commit/0ff5fb98745a511118df5b1a68ca54d892b08ee3)
    • Support of PHP 8 (https://github.com/elastic/elasticsearch-php/pull/1095 and https://github.com/elastic/elasticsearch-php/pull/1063)
    • Replace array_walk with array_map in Connection::getURI (https://github.com/elastic/elasticsearch-php/pull/1075)
    • Fix for #1064 reset custom headers (https://github.com/elastic/elasticsearch-php/pull/1065)
    • Replace guzzlehttp/ringphp with ezimuel/ringphp (https://github.com/elastic/elasticsearch-php/pull/1102)
    Source code(tar.gz)
    Source code(zip)
  • v7.11.0(Feb 11, 2021)

    This release is compatible with the latest Elasticsearch 7.11.0 released in 10th February 2021. This is the first release to be compatible with PHP 8.

    It includes the following fixes and improvements:

    • #1089 Added the X-Elastic-Client-Meta header which is used by Elastic Cloud and can be disabled with ClientBuilder::setElasticMetaHeader(false)
    • #1075 Replaced array_walk with array_map in Connection::getURI for PHP 8 compatibility
    • #1069 Remove unnecessary InvalidArgumentExceptions
    • #1063 Introducing PHP 8 compatibility
    • #1062 Replace Sami by Doctum and fix .gitignore

    Added the following new APIs ๐ŸŽ‰ (6 stable, 1 experimental):

    Stable

    Experimental

    API changes

    • Cat.tasks, the parameters node_id and parent_task has been changed in nodes and parent_task_id
    • Cluster.deleteComponentTemplate, this API has become STABLE, it was EXPERIMENTAL before
    • Cluster.existsComponentTemplate, this API has become STABLE, it was EXPERIMENTAL before
    • Cluster.getComponentTemplate, this API has become STABLE, it was EXPERIMENTAL before
    • Cluster.putComponentTemplate, this API has become STABLE, it was EXPERIMENTAL before
    • Indices.deleteIndexTemplate, this API has become STABLE, it was EXPERIMENTAL before
    • Indices.existsIndexTemplate, this API has become STABLE, it was EXPERIMENTAL before
    • Indices.getIndexTemplate, this API has become STABLE, it was EXPERIMENTAL before
    • Indices.putIndexTemplate, this API has become STABLE, it was EXPERIMENTAL before
    • Indices.simulateIndexTemplate, this API has become STABLE, it was EXPERIMENTAL before
    • Indices.simulateTemplate, this API has become STABLE, it was EXPERIMENTAL before
    • DataFrameTransformDeprecated.getTransform (BETA API), added the exclude_generated parameter: (boolean) Omits generated fields. Allows transform configurations to be easily copied between clusters and within the same cluster (Default = false)
    • Eql.delete, this API has become STABLE, it was BETA before
    • Eql.get, this API has become STABLE, it was BETA before
    • Eql.search, this API has become STABLE, it was BETA before
    • Indices.deleteDataStream, added expand_wildcards parameter: (enum) Whether wildcard expressions should get expanded to open or closed indices (default: open) (Options = open,closed,hidden,none,all) (Default = open)
    • Indices.getDataStream, added expand_wildcards parameter: (enum) Whether wildcard expressions should get expanded to open or closed indices (default: open) (Options = open,closed,hidden,none,all) (Default = open)
    • Ml.deleteDataFrameAnalytics, this API has become BETA, it was EXPERIMENTAL before
    • Ml.deleteTrainedModel, this API has become BETA, it was EXPERIMENTAL before
    • Ml.explainDataFrameAnalytics, this API has become BETA, it was EXPERIMENTAL before
    • Ml.getDataFrameAnalytics, this API has become BETA, it was EXPERIMENTAL before
    • Ml.getDatafeeds, added the exclude_generated parameter: (boolean) Omits fields that are illegal to set on data frame analytics PUT (Default = false)
    • Ml.getJobs, added the exclude_generated parameter: (boolean) Omits fields that are illegal to set on job PUT (Default = false)
    • Ml.getTrainedModels, this API has become BETA, it was EXPERIMENTAL before. Added the exclude_generated paremeter: (boolean) Omits fields that are illegal to set on model PUT (Default = false). Removed the for_export parameter
    • Ml.getTrainedModelsStats, this API has become BETA, it was EXPERIMENTAL before
    • Ml.putDataFrameAnalytics, this API has become BETA, it was EXPERIMENTAL before
    • Ml.putTrainedModel, this API has become BETA, it was EXPERIMENTAL before
    • Ml.startDataFrameAnalytics, this API has become BETA, it was EXPERIMENTAL before
    • Ml.stopDataFrameAnalytics, this API has become BETA, it was EXPERIMENTAL before
    • Ml.updateDataFrameAnalytics, this API has become BETA, it was EXPERIMENTAL before
    • Transform.getTransform, added the exclude_generated parameter: (boolean) Omits fields that are illegal to set on transform PUT (Default = false)
    Source code(tar.gz)
    Source code(zip)
  • v7.10.0(Nov 11, 2020)

    This release is compatible with the latest Elasticsearch 7.10.0 released in 11th November 2020.

    It includes the following fixes and improvements:

    • Fixed ClientBuilder::fromConfig allowing multiple function parameters (e.g. setApiKey) #1076
    • Refactored the YAML tests using generated PHPUnit code 85fadc2

    Added the following new APIs ๐ŸŽ‰:

    Stable

    API changes

    • Bulk: added the require_alias parameter = (boolean) Sets require_alias for all incoming documents. Defaults to unset (false).

    • Index: added the require_alias parameter = (boolean) When true, requires destination to be an alias. Default is false.

    • Update: added the require_alias parameter = (boolean) When true, requires destination is an alias. Default is false.

    • Cat.mlDatafeeds: added the allow_no_match parameter = (boolean) Whether to ignore if a wildcard expression matches no datafeeds. This includes _all string or when no datafeeds have been specified.

    • Cat.mlJobs: added the allow_no_match parameter = (boolean) Whether to ignore if a wildcard expression matches no datafeeds. This includes _all string or when no datafeeds have been specified.

    • Ml.closeJob: added the allow_no_match parameter = (boolean) Whether to ignore if a wildcard expression matches no jobs. This includes _all string or when no jobs have been specified.

    • Ml.getDatafeeds: added the allow_no_match parameter = (boolean) Whether to ignore if a wildcard expression matches no datafeeds. This includes _all string or when no datafeeds have been specified.

    • Ml.getJobStats: added the allow_no_match parameter = (boolean) Whether to ignore if a wildcard expression matches no jobs. This includes _all string or when no jobs have been specified.

    • Ml.getJobs: added the allow_no_match parameter = (boolean) Whether to ignore if a wildcard expression matches no jobs. This includes _all string or when no jobs have been specified.

    • Ml.getOverallBuckets: added the allow_no_match parameter = (boolean) Whether to ignore if a wildcard expression matches no jobs. This includes _all string or when no jobs have been specified.

    • Ml.getTrainedModels (EXPERIMENTAL API): added the include parameter = (string) A comma-separate list of fields to optionally include. Valid options are definition and total_feature_importance. Default is none.

    • Ml.stopDatafeed: added the allow_no_match parameter = (boolean) Whether to ignore if a wildcard expression matches no datafeeds. This includes _all string or when no datafeeds have been specified.

    Source code(tar.gz)
    Source code(zip)
  • v7.9.1(Oct 6, 2020)

  • v7.9.0(Aug 18, 2020)

    This release is compatible with the latest Elasticsearch 7.9.0 released in 18th August 2020.

    It includes the following fixes:

    • Moved scroll_id into body for search operations in the documentation #1052
    • Fixed PHP 7.4 preloading feature for autoload.php #1051
    • Improved message of JSON errors using json_last_error_msg() #1045
    • Make ClientBuilder override possible, using static instead of self #1036

    Added the following new APIs ๐ŸŽ‰:

    Stable

    Beta

    Beta APIs are on track to become stable and permanent features. Use them with caution because it is possible that breaking changes are made to these APIs in a minor version.

    Experimental

    Experimental APIs are just that - an experiment. An experimental API might have breaking changes in any future version, or it might even be removed entirely.

    API changes

    • Indices.putMapping: added the write_index_only parameter = (boolean) When true, applies mappings only to the write index of an alias or data stream (Default = false)

    • Ml.deleteExpiredData: added the following parameters:

      • job_id (string) The ID of the job(s) to perform expired data hygiene for
      • requests_per_second (number) The desired requests per second for the deletion processes
      • timeout (time) How long can the underlying delete processes run until they are canceled
      • body (array) deleting expired data parameters
    • Ml.forecast: added the parameter max_model_memory (string) The max memory able to be used by the forecast. Default is 20mb.

    • Ml.getCategories: added the parameter partition_field_value (string) Specifies the partition to retrieve categories for. This is optional, and should never be used for jobs where per-partition categorization is disabled

    • Ml.getTrainedModels: added the parameter for_export (boolean) Omits fields that are illegal to set on model PUT (Default = false)

    • Xpack.info: added the parameter accept_enterprise (boolean) If an enterprise license is installed, return the type and mode as 'enterprise' (default: false)

    • Indices.deleteDataStream: changed the name parameter from string to list (a comma-separated list of data streams to delete; use * to delete all data streams)

    • Indices.getDataStream (name changed from getDataStreams): changed the name parameter from string to list (a comma-separated list of data streams to get; use * to get all data streams)

    Source code(tar.gz)
    Source code(zip)
  • v7.4.2(Aug 11, 2020)

    This release fixes https://github.com/elastic/elasticsearch-php/issues/1048 and #1017 issues with indexing failure for item IDs that contain slashes.

    Source code(tar.gz)
    Source code(zip)
  • v7.8.0(Jun 18, 2020)

    This release is compatible with the latest Elasticsearch 7.8.0 released in 18th June 2020.

    It includes the following new endpoints ๐ŸŽ‰:

    and the following changes:

    • Indices.getDataStreams, changed the name parameter type to string, instead of list
    • Tasks.cancel, added wait_for_completion boolean parameter. Can be use to block the request until the cancellation of the task and its descendant tasks is completed. Defaults to false
    • Ml.deleteExpiredData, added body containing deleting expired data parameters
    • Ml.deleteDataFrameAnalytics, added timeout controls the time to wait until a job is deleted. Defaults to 1 minute

    Elasticsearch 7.8.0 includes also some experimental APIs. Pleas note, an experimental API might have breaking changes in any future version, or it might even be removed entirely.

    and the new Searchable snapshot namespace with the following experimental APIs:

    Source code(tar.gz)
    Source code(zip)
  • v7.7.0(May 13, 2020)

    This release is compatible with the latest Elasticsearch 7.7.0 released in 13th May 2020.

    It contains the following new features ๐ŸŽ‰:

    • Added JUnit log for PHPUnit 88b7e1c
    • Added the XPack endpoints 763d91a

    and fixes :

    • Removed setId() into endpoints, fixed util/GenerateEndpoints.php #1026
    • Fixes JsonErrorException with code instead of message #1022
    • Better exception message for Could not parse URI #1016

    XPack endpoints ๐ŸŽ‰

    In this release we included all the XPack endpoints, that was previously managed in a separate repository elastic/elasticsearch-x-pack-php (not updated since Elasticsearch 5.0 :sweat:).

    These APIs are related to:

    New APIs added to Elasticsearch 7.7.0

    Elasticsearch 7.7.0 includes the following new APIs:

    Cluster

    AsyncSearch

    Autoscaling

    Cat

    Eql

    Machine Learning (ML)

    Experimental APIs:

    Elasticsearch 7.7.0 includes also some experimental APIs. Pleas note, an experimental API might have breaking changes in any future version, or it might even be removed entirely.

    Source code(tar.gz)
    Source code(zip)
  • v7.5.2(Feb 17, 2020)

Plastic is an Elasticsearch ODM and mapper for Laravel. It renders the developer experience more enjoyable while using Elasticsearch, by providing a fluent syntax for mapping, querying, and storing eloquent models.

Plastic is an Elasticsearch ODM and mapper for Laravel. It renders the developer experience more enjoyable while using Elasticsearch, by providing a f

Sleiman Sleiman 511 Dec 31, 2022
Elastica is a PHP client for elasticsearch

Elastica: elasticsearch PHP Client All documentation for Elastica can be found under Elastica.io. If you have questions, don't hesitate to ask them on

Nicolas Ruflin 2.2k Dec 23, 2022
Build and execute an Elasticsearch search query using a fluent PHP API

PACKAGE IN DEVELOPMENT, DO NOT USE YET Build and execute ElasticSearch queries using a fluent PHP API This package is a lightweight query builder for

Spatie 94 Dec 14, 2022
Maps Laravel Eloquent models to Elasticsearch types

Elasticquent Elasticsearch for Eloquent Laravel Models Elasticquent makes working with Elasticsearch and Eloquent models easier by mapping them to Ela

Elasticquent 1.3k Jan 4, 2023
Store and retrieve objects from Algolia or Elasticsearch

Store and retrieve objects from a search index This is an opinionated Laravel 5.1 package to store and retrieve objects from a search index. Currently

Spatie 440 Dec 30, 2022
Elasticsearch driver for Laravel Scout

Elasticsearch driver for Laravel Scout. Contents Compatibility Installation Configuration Basic Usage Advanced Search Migrations Pitfalls Compatibilit

Ivan Babenko 197 Dec 19, 2022
Elasticsearch migrations for Laravel

Elastic Migrations Elasticsearch migrations for Laravel allow you to easily modify and share indices schema across the application's environments. Con

Ivan Babenko 151 Dec 20, 2022
Search among multiple models with ElasticSearch and Laravel Scout

For PHP8 support use php8 branch For Laravel Framework < 6.0.0 use 3.x branch The package provides the perfect starting point to integrate ElasticSear

Sergey Shlyakhov 592 Dec 25, 2022
This package offers advanced functionality for searching and filtering data in Elasticsearch.

Scout Elasticsearch Driver ?? Introducing a new Elasticsearch ecosystem for Laravel. ?? This package offers advanced functionality for searching and f

Ivan Babenko 1.2k Dec 20, 2022
Laravel 8.* Elasticsearch Eloquent

Elasticsearch Installation composer require etsetra/elasticsearch Create config file $ php artisan vendor:publish --tag="etsetra-elasticsearch-config

Etsetra 2 Jan 14, 2022
This modules provides a Search API Backend for Elasticsearch.

Search API ElasticSearch This modules provides a Search API Backend for Elasticsearch. This module uses the official Elasticsearch PHP Client. Feature

null 1 Jan 20, 2022
Search products, categories, brands or tags with ElasticSearch

ElasticSearch for Shopaholic This plugin allows you to use ElasticSearch as search engine for Shopaholic. Benefits Easy to install, easy to use Opened

Biz-Mark 4 Feb 18, 2022
Query Builder for Elasticsearch

Query Builder for Elasticsearch

wangzhiqiang 5 Mar 2, 2022
The official SingleStore Laravel driver.

SingleStore Driver for Laravel This repository contains a SingleStore Driver for Laravel. Install You can install the package via composer: composer r

SingleStore Labs 197 Jan 1, 2023
MeiliSearch PHP is the MeiliSearch API client for PHP developers.

MeiliSearch PHP is the MeiliSearch API client for PHP developers. โšก The MeiliSearch API client written for PHP ??

MeiliSearch 362 Jan 4, 2023
PHP Solr client library

Solarium PHP Solr Client Library What is Solarium? Solarium is a PHP Solr client library that accurately models Solr concepts. Where many other Solr l

Solarium PHP library organization 902 Dec 30, 2022
A fully featured full text search engine written in PHP

TNTSearch TNTSearch is a full-text search (FTS) engine written entirely in PHP. A simple configuration allows you to add an amazing search experience

TNT Studio 2.9k Jan 8, 2023
A php trait to search laravel models

Searchable, a search trait for Laravel Searchable is a trait for Laravel 4.2+ and Laravel 5.0 that adds a simple search function to Eloquent Models. S

Nicolรกs Lรณpez Jullian 2k Dec 27, 2022
ScoutAPM PHP Agent for the Laravel Framework

Scout Laravel APM Agent Monitor the performance of PHP Laravel applications with Scout's PHP APM Agent. Detailed performance metrics and transaction t

Scout APM 22 Jan 2, 2023