Code Monkey home page Code Monkey logo

laravel-elasticsearch's People

Contributors

303k avatar adriacanal avatar ahmedash95 avatar axe-me avatar bburr avatar bmartel avatar cviebrock avatar danieljaniga avatar dinomh avatar glgeorgiev avatar harrisonbro avatar james-brown-upfeat avatar khoatran avatar lednerb avatar matejvelikonja avatar matrix86 avatar mjoshuase avatar mushood avatar nklmilojevic avatar nsaliu avatar okdewit avatar pavel-pepper avatar petercoles avatar prinsfrank avatar ristedavcevski avatar shuvroroy avatar sirnarsh avatar tufanbarisyildirim avatar xian13 avatar zeidanbm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-elasticsearch's Issues

How do i use this package?

I want to use this package for my laravel elasticsearch project, but i dont know how to include this package in my project.
image
This is the error i get when i use it

Doesn't work for Laravel 7.x or missing instructions?

Following the readme, I'm stuck at the following part:

You can now replace those last two lines with simply:

$return = Elasticsearch::index($data);

It would appear not, as this simply throws an Class 'App\\Http\\Controllers\\Elasticsearch' not found error. Is something special required to load this facade in Laravel 7?

I tried including the following as well, but that did not help:

use Cviebrock\LaravelElasticsearch\Facade as Elasticsearch;

Note: Using the ES Client directly works fine.

FatalThrowableError: Class 'App\Http\Controllers\Elasticsearch' not found

Hi,

I followed the instructions on installation and usage in the ReadMe 3 times, every time starting over with a fresh Laravel project and removing composer packages that were left behind because of global installs. Somehow I keep getting the same error, regardless of the fresh installs.

I'm really new to Laravel, but so far things seem to make sense and I have been able to solve my issues with logic and reasoning an googling. But this issue keeps returning and I can't figure out why this is happening. Can someone tell me why this is happening, and what I'm doing wrong?

I'm using Laravel Framework 5.4.24 and ElasticSearch 5.2.2.

Thanks!

canphaz

screen shot 2017-06-04 at 20 23 18

screen shot 2017-06-04 at 20 17 33

Issue with namespace

I think there is an issue with the namespaces of this package. It could be an issue with my application but after install the following error is generated:

  [Symfony\Component\Debug\Exception\FatalErrorException]
  Class 'Cviebrock\LaravelElasticSearch\ElasticServiceProvider' not found

Checking the autoload_classmap.php the classes look like they exist properly:

    'Cviebrock\\LaravelElasticsearch\\ServiceProvider' => $vendorDir . '/cviebrock/laravel-elasticsearch/src/ServiceProvider.php',
    'Cviebrock\\LaravelElasticsearch\\Facade' => $vendorDir . '/cviebrock/laravel-elasticsearch/src/Facade.php',
    'Cviebrock\\LaravelElasticsearch\\Factory' => $vendorDir . '/cviebrock/laravel-elasticsearch/src/Factory.php',
    'Cviebrock\\LaravelElasticsearch\\Manager' => $vendorDir . '/cviebrock/laravel-elasticsearch/src/Manager.php',

Looking over the code I did not see any issue with the namespaces that seemed obvious. My app config line looks like this:

    'providers' => [
...
    Cviebrock\LaravelElasticSearch\ServiceProvider::class,

Will come back to this next week when I have more time and can install on a fresh laravel project.

Call to undefined function Aws\default_http_handler()

Running into the following error when trying to work with AWS. If I instead use a local Elasticsearch connection everything works as expected.

I'm using elasticsearch/elasticsearch@v6.7.0 and cviebrock/laravel-elasticsearch@3.5.1. I've tried various other versions too but still hit the same issue.

Symfony\Component\Debug\Exception\FatalThrowableError : Call to undefined function Aws\default_http_handler() at /www/sites/suru-partners/countryside-classroom/vendor/cviebrock/laravel-elasticsearch/src/Factory.php:93

    89| 
    90|         foreach ($config['hosts'] as $host) {
    91|             if (isset($host['aws']) && $host['aws']) {
    92|                 $clientBuilder->setHandler(function(array $request) use ($host) {
  > 93|                     $psr7Handler = \Aws\default_http_handler();
    94|                     $signer = new \Aws\Signature\SignatureV4('es', $host['aws_region']);
    95|                     $request['headers']['Host'][0] = parse_url($request['headers']['Host'][0])['host'];
    96| 
    97|                     // Create a PSR-7 request from the array passed to the handler

Exception trace:

  1   Cviebrock\LaravelElasticsearch\Factory::Cviebrock\LaravelElasticsearch\{closure}()
      /www/sites/suru-partners/countryside-classroom/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:202

  2   Elasticsearch\Connections\Connection::Elasticsearch\Connections\{closure}(Object(Elasticsearch\Connections\Connection), Object(Elasticsearch\Transport), [])
      /www/sites/suru-partners/countryside-classroom/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:177

analyzer [ngramAnalyzer] not found for field [ngram]

Hello elasticSearch team,
i am getting an issue
analyzer [ngramAnalyzer] not found for field [ngram]

`"creation_date":"1509705248466","number_of_shards":"5","number_of_replicas":"1","uuid":"f9g0f5dLQr6uR6J8ItYMqA","version":{   

"created":"5050099"},"provided_name":"twitter"}}},


"analyze":{   

"settings":{   

"index":{   

"number_of_shards":"5","provided_name":"analyze","creation_date":"1510213806813","analysis":{   

"filter":{   

"quadgrams_filter":{   

"type":"ngram","min_gram":"4","max_gram":"4"},"autocomplete_filter":{   

"type":"edge_ngram","min_gram":"1","max_gram":"20"}},"analyzer":{   

"ngramAnalyzer":{   

"filter":["asciifolding","lowercase","quadgrams_filter"],"type":"custom","tokenizer":"standard"},"standardAnalyzer":{   

"filter":["asciifolding","lowercase"],"type":"custom","tokenizer":"standard"},"allAnalyzer":{   

"filter":["asciifolding","lowercase","autocomplete_filter"],"type":"custom","tokenizer":"standard"}}},"number_of_replicas":"1","uuid":"h1x3o3BCQHyP_e9MCuofNg","version":{   

"created":"5050099"}}}}}`

How to use Elasticsearch's mapping ?

Hi !
I would like to use your library with something like this:

Elasticsearch::mapping(['index' => $name, "body" => $body]);

For to do like on http:

localhost:9200/MyIndex/_mapping/doc

with this in the body:

{
    "properties": {
        "MyField": {
            "type": "text",
            "fielddata": true
        }
    }
} 

Like I do for my search :

Elasticsearch::search(['index' => $name, '_source' => $columnFilter,
            'size' => $request->get('size'),
            "from" => $request->get('offset'),
            "body" => $body]);

Thanks in any case :)

Class path.config does not exist

On Lumen: 5.4

When I followed the documentation and tried to run tinker, I got below:

[ReflectionException]
    Class path.config does not exist

I resolved this issue by replacing:

$app->register(Cviebrock\LaravelElasticsearch\ServiceProvider::class);

with:

$app->register(Cviebrock\LaravelElasticsearch\LumenServiceProvider::class);

I think the documentation has this incorrect. Maybe you copied the line from the Laravel section and forgot to rename the ServiceProvider::class with LumenServiceProvider::class

laravel-elasticsearch v2 - "explain", "from", "highlight", "query", "size" are not valid parameters

So we currently are using ElasticSearch version 5.5 on the backend, and I'm trying to use this laravel-elasticsearch client (version ^2) to do queries. however, it complains that several parameters are not valid. These same parameters work when doing a vanilla curl call to the elastic search server, so I'm not sure why they wouldn't work with this client, given that version 2 is supposed to be compatible with Elasticsearch 5. Here is my search query for reference:

    $fields = ['feed_name^2', 'title^2', 'description'];

    $query = [
        'from'      => 0,
        'size'      => 15,
        'explain'   => false,
        'query'     => [
            'function_score' => [
                'query' => [
                    'bool' => [
                        'must'   => [
                            'multi_match' => [
                                'query'  => $input['q'],
                                'type'   => 'cross_fields',
                                'slop'   => 10,
                                'fields' => $fields,
                            ]
                        ],
                        'should' => [
                            [
                                'multi_match' => [
                                    'query'          => $input['q'],
                                    'fields'         => $fields,
                                    'type'           => 'phrase',
                                    'boost'           => 1.5,
                                ]
                            ],
                            [
                                'multi_match' => [
                                    'query'          => $input['q'],
                                    'fields'         => 'title',
                                    'type'           => 'phrase_prefix',
                                    'boost'          => 2.0,
                                    'max_expansions' => 50,
                                    'slop'           => 10
                                ]
                            ]
                        ]
                    ]
                ],
                'field_value_factor' => [
                    'field'    => 'stitcher_list_ranking',
                    'modifier' => 'log1p',
                    'factor'   => 10,
                ],
                'boost_mode'         => 'multiply'
            ]
        ],
        'highlight' => [
            'order' => 'score',
            'fields' => [
                'feed_name'   => [
                    'fragment_size' => 100
                ],
                'title'       => [
                    'fragment_size' => 100
                ],
                'description' => [
                    'fragment_size' => 100
                ]
            ]
        ]
    ];

    return Elasticsearch::index($query);

Integration Demo Sample

Hi,
Please I try to make an elasticsearch on my Laravel 5.8 project.
So first I install elacticseach in my macOs:
brew install elasticsearch
After that, I create a new laravel project and I download your package but I didn't figure it out.
Can you please add a sample demo for use, I would be very grateful for that. Thank's.

Not able to access on AWS Elastic search cluster

Hi ,
I have used the package and it works well if I directly use on local server, but when I used the AWS elastic search and changed to below configuration it stoped working

ELASTICSEARCH_HOST=elastic_search_end_point (initially localhost)
ELASTICSEARCH_PORT=80 (initially 9200)
ELASTICSEARCH_SCHEME=http
ELASTICSEARCH_USER=
ELASTICSEARCH_PASS=

I get below error:

{"message":"Authorization header requires 'Credential' parameter. Authorization header requires 'Signature' parameter. Authorization header requires 'SignedHeaders' parameter. Authorization header requires existence of either a 'X-Amz-Date' or a 'Date' header. Authorization=Basic Og=="}

Elastic Search Aws Services : https://aws.amazon.com/elasticsearch-service/

Please help me to make this workable , thanks in advance

elasticsearch server not connected,getting error No alive nodes found in your cluster

Please be sure you inc

  • steps taken to reproduce your issue
  • your configuration file(s), where relevant
  • a copy of your Models that use or extend this package (just the relevant parts!)
  • any other code we might need to help

Please use a descriptive title for your issue. "Why doesn't this work?" doesn't provide
other users much information if they are scanning the list of issues.

Also, please use fenced code blocks
when pasting more than one line of code. It makes it so much more readable for everyone!

Thank you!

documentation and/or examples

I've used elasticsearch in Node.JS but never used in PHP/Laravel. Tried to play around but couldn't understand how to do. Is it possible to provide some examples and documentation other than main readme.md file?

Missing Parameter in returned response from the AWS Handler

I've Version 4.1.1 of this package with version 7.5 for elasticsearch.

On this line in the Factory a response is returned from the AWS handler. It is missing a property named primary_port in transfer_stats that is required by the elasticsearch library here

Factory.php

 // Convert the PSR-7 response to a RingPHP response
 return new \GuzzleHttp\Ring\Future\CompletedFutureArray([
        'status' => $response->getStatusCode(),
        'headers' => $response->getHeaders(),
        'body' => $response->getBody()->detach(),
        'transfer_stats' => ['total_time' => 0],
        'effective_url' => (string)$psr7Request->getUri(),
]);

Connection.php

 public function logRequestSuccess(array $request, array $response): void
    {
        $this->log->debug('Request Body', array($request['body']));
        $this->log->info(
            'Request Success:',
            array(
                'method'    => $request['http_method'],
                'uri'       => $response['effective_url'],
                'port'      => $response['transfer_stats']['primary_port'],
                'headers'   => $request['headers'],
                'HTTP code' => $response['status'],
                'duration'  => $response['transfer_stats']['total_time'],
            )
        );
        $this->log->debug('Response', array($response['body']));

Added in this commit
On 2019-09-19

Can't upgrade Laravel to 5.6

Recently I'm going to upgrade my Laravel version to the latest 5.6.3.
But the following issue in the laravel-elasticsearch stop it!

image

Filter research

Hello, I'm trying to filter results by dates, I tried adding a "filter" parameter in my search query but I got an error saying it was not an authorized parameter. How can I do it ?

Laravel >7.x Support

I'm unable to install this package using Laravel v7.16.1, below is the output I received while trying to install the library.

`
Problem 1
- Conclusion: don't install cviebrock/laravel-elasticsearch 2.1.0
- Conclusion: don't install cviebrock/laravel-elasticsearch 2.0.1
- Conclusion: don't install cviebrock/laravel-elasticsearch 2.0.0
- Conclusion: remove laravel/framework v7.16.1
- Installation request for cviebrock/laravel-elasticsearch ^2 -> satisfiable by cviebrock/laravel-elasticsearch[2.0.0, 2.0.1, 2.0.x-dev, 2.1.0].
- Conclusion: don't install laravel/framework v7.16.1
- cviebrock/laravel-elasticsearch 2.0.x-dev requires illuminate/support ~5 -> satisfiable by laravel/framework[5.5.x-dev, 5.6.x-dev, 5.7.x-dev, 5.8.x-dev], illuminate/support[5.0.x-dev, 5.1.x-dev, 5.2.x-dev, 5.3.x-dev, 5.4.x-dev, 5.5.x-dev, 5.6.x-dev, 5.7.17, 5.7.18, 5.7.19, 5.7.x-dev, 5.8.x-dev, v5.0.0, v5.0.22, v5.0.25, v5.0.26, v5.0.28, v5.0.33, v5.0.4, v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1.8, v5.2.0, v5.2.19, v5.2.21, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.31, v5.2.32, v5.2.37, v5.2.43, v5.2.45, v5.2.6, v5.2.7, v5.3.0, v5.3.16, v5.3.23, v5.3.4, v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.27, v5.4.36, v5.4.9, v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34, v5.5.35, v5.5.36, v5.5.37, v5.5.39, v5.5.40, v5.5.41, v5.5.43, v5.5.44, v5.6.0, v5.6.1, v5.6.10, v5.6.11, v5.6.12, v5.6.13, v5.6.14, v5.6.15, v5.6.16, v5.6.17, v5.6.19, v5.6.2, v5.6.20, v5.6.21, v5.6.22, v5.6.23, v5.6.24, v5.6.25, v5.6.26, v5.6.27, v5.6.28, v5.6.29, v5.6.3, v5.6.30, v5.6.31, v5.6.32, v5.6.33, v5.6.34, v5.6.35, v5.6.36, v5.6.37, v5.6.38, v5.6.39, v5.6.4, v5.6.5, v5.6.6, v5.6.7, v5.6.8, v5.6.9, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.26, v5.7.27, v5.7.28, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9, v5.8.0, v5.8.11, v5.8.12, v5.8.14, v5.8.15, v5.8.17, v5.8.18, v5.8.19, v5.8.2, v5.8.20, v5.8.22, v5.8.24, v5.8.27, v5.8.28, v5.8.29, v5.8.3, v5.8.30, v5.8.31, v5.8.32, v5.8.33, v5.8.34, v5.8.35, v5.8.36, v5.8.4, v5.8.8, v5.8.9].
- Can only install one of: laravel/framework[5.5.x-dev, v7.16.1].
- Can only install one of: laravel/framework[5.6.x-dev, v7.16.1].
- Can only install one of: laravel/framework[5.7.x-dev, v7.16.1].
- Can only install one of: laravel/framework[5.8.x-dev, v7.16.1].
- don't install illuminate/support 5.5.x-dev|don't install laravel/framework v7.16.1
- don't install illuminate/support 5.6.x-dev|don't install laravel/framework v7.16.1
- don't install illuminate/support 5.7.17|don't install laravel/framework v7.16.1
- don't install illuminate/support 5.7.18|don't install laravel/framework v7.16.1
- don't install illuminate/support 5.7.19|don't install laravel/framework v7.16.1
- don't install illuminate/support 5.7.x-dev|don't install laravel/framework v7.16.1
- don't install illuminate/support 5.8.x-dev|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.5.0|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.5.16|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.5.17|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.5.2|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.5.28|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.5.33|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.5.34|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.5.35|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.5.36|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.5.37|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.5.39|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.5.40|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.5.41|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.5.43|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.5.44|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.0|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.1|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.10|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.11|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.12|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.13|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.14|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.15|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.16|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.17|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.19|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.2|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.20|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.21|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.22|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.23|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.24|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.25|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.26|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.27|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.28|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.29|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.3|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.30|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.31|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.32|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.33|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.34|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.35|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.36|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.37|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.38|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.39|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.4|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.5|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.6|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.7|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.8|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.6.9|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.7.0|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.7.1|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.7.10|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.7.11|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.7.15|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.7.2|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.7.20|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.7.21|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.7.22|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.7.23|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.7.26|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.7.27|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.7.28|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.7.3|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.7.4|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.7.5|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.7.6|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.7.7|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.7.8|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.7.9|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.0|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.11|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.12|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.14|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.15|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.17|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.18|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.19|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.2|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.20|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.22|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.24|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.27|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.28|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.29|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.3|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.30|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.31|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.32|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.33|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.34|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.35|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.36|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.4|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.8|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.8.9|don't install laravel/framework v7.16.1
- don't install illuminate/support 5.4.x-dev|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.4.0|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.4.13|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.4.17|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.4.19|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.4.27|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.4.36|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.4.9|don't install laravel/framework v7.16.1
- don't install illuminate/support 5.3.x-dev|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.3.0|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.3.16|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.3.23|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.3.4|don't install laravel/framework v7.16.1
- don't install illuminate/support 5.1.x-dev|don't install laravel/framework v7.16.1
- don't install illuminate/support 5.2.x-dev|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.1.1|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.1.13|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.1.16|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.1.2|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.1.20|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.1.22|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.1.25|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.1.28|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.1.30|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.1.31|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.1.41|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.1.6|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.1.8|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.2.0|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.2.19|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.2.21|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.2.24|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.2.25|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.2.26|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.2.27|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.2.28|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.2.31|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.2.32|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.2.37|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.2.43|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.2.45|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.2.6|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.2.7|don't install laravel/framework v7.16.1
- don't install illuminate/support 5.0.x-dev|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.0.0|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.0.22|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.0.25|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.0.26|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.0.28|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.0.33|don't install laravel/framework v7.16.1
- don't install illuminate/support v5.0.4|don't install laravel/framework v7.16.1
- Installation request for laravel/framework (locked at v7.16.1, required as ^7.0) -> satisfiable by laravel/framework[v7.16.1].

Installation failed, reverting ./composer.json to its original content.
`

I can't get to work with Facades

Hi,
I'm trying to use the Elasticsearch facade into my Lumen app but no luck!

I followed the instructions but i get this error message :

"Type error: Argument 1 passed to Cviebrock\LaravelElasticsearch\Manager::__construct() must be an instance of Illuminate\Contracts\Foundation\Application, instance of Laravel\Lumen\Application given, called in C:\xampp\htdocs\lf-api\vendor\cviebrock\laravel-elasticsearch\src\ServiceProvider.php on line 49"

Here is a cut from my composer.json
"require": { "php": ">=5.6.4", "laravel/lumen-framework": "5.4.*", "vlucas/phpdotenv": "~2.2", "krisanalfa/lumen-dingo-adapter": "^0.0.3", "league/fractal": "^0.17.0", "cviebrock/laravel-elasticsearch": "2" },

Published config file is not working

Hi. First of all, thank you for a great package!

I'm having an issue with published configuration file. As specified in docs, I've ran:
php artisan vendor:publish --provider="Cviebrock\LaravelElasticsearch\ServiceProvider

That created a file in config/elasticsearch.php, which I adjusted for my needs. However, I can still see that vendor/cviebrock/laravel-elasticsearch/config/elasticsearch.php is being used instead. I tried to do composer dumpautoload just to be sure, but that does nothing for the issue.

Using environment variables to configure ES connection is not really an option for me, as I'm running on heroku and need to make certain adjustments in the code.

I am using 3.1.1 version with Laravel 5.6.23

Support for 5.x

Can you bump the version support to include elasticsearch 5.x if everything tests out?

Elasticsearch-PHP requires cURL, or a custom HTTP handler

Elasticsearch-PHP requires cURL, or a custom HTTP handler. {"exception":"[object] (RuntimeException(code: 0): Elasticsearch-PHP requires cURL, or a custom HTTP handler. at /vendor/elasticsearch/elasticsearch/src/Elasticsearch/ClientBuilder.php:184)

it's a error in production env recently,before it's ok.

No alive nodes found in your cluster

"message": "No alive nodes found in your cluster",
"exception": "Elasticsearch\Common\Exceptions\NoNodesAvailableException",
"file": "C:\xampp\htdocs\erp\vendor\elasticsearch\elasticsearch\src\Elasticsearch\ConnectionPool\StaticNoPingConnectionPool.php",
"line": 51,
"trace": [
{
"file": "C:\xampp\htdocs\erp\vendor\elasticsearch\elasticsearch\src\Elasticsearch\Transport.php",
"line": 72,
"function": "nextConnection",
"class": "Elasticsearch\ConnectionPool\StaticNoPingConnectionPool",
"type": "->"
},

Lumen is not supported since version 3.2.0

After requiring the Laravel framework in this commit, the package can no longer be installed on a Lumen application.

What was the need of requiring the whole Laravel framework?

This is what i get when trying to install this package on Lumen 5.7 because laravel/framework is now a required package.

Using version ^3.2 for cviebrock/laravel-elasticsearch
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 12 installs, 1 update, 22 removals
  - Removing illuminate/broadcasting (v5.7.9)
  - Removing illuminate/bus (v5.7.9)
  - Removing illuminate/cache (v5.7.9)
  - Removing illuminate/config (v5.7.9)
  - Removing illuminate/console (v5.7.9)
  - Removing illuminate/container (v5.7.9)
  - Removing illuminate/contracts (v5.7.9)
  - Removing illuminate/database (v5.7.9)
  - Removing illuminate/encryption (v5.7.9)
  - Removing illuminate/events (v5.7.9)
  - Removing illuminate/filesystem (v5.7.9)
  - Removing illuminate/hashing (v5.7.9)
  - Removing illuminate/http (v5.7.9)
  - Removing illuminate/log (v5.7.9)
  - Removing illuminate/pagination (v5.7.9)
  - Removing illuminate/pipeline (v5.7.9)
  - Removing illuminate/queue (v5.7.9)
  - Removing illuminate/session (v5.7.9)
  - Removing illuminate/support (v5.7.9)
  - Removing illuminate/translation (v5.7.9)
  - Removing illuminate/validation (v5.7.9)
  - Removing illuminate/view (v5.7.9)
  - Installing symfony/css-selector (v4.1.7): Downloading (100%)  
 ...

Error: After last composer update

PHP Fatal error: Call to undefined method Cviebrock\LaravelElasticsearch\ServiceProvider::publishes() in {project}/vendor/cviebrock/laravel-elasticsearch/src/ServiceProvider.php on line 32
{"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"Call to undefined method Cviebrock\LaravelElasticsearch\ServiceProvider::publishes()","file":"{project}/vendor/cviebrock/laravel-elasticsearch/src/ServiceProvider.php","line":32}}Script php artisan clear-compiled handling the post-update-cmd event returned with an error

[RuntimeException]
Error Output: PHP Fatal error: Call to undefined method Cviebrock\LaravelElasticsearch\ServiceProvider::publishes() in {project}/ve
ndor/cviebrock/laravel-elasticsearch/src/ServiceProvider.php on line 32

I solved this by commenting the following code block:

Line 32:
// $this->publishes([
// $configPath => config_path('elasticsearch.php'),
// ]);

Apparently the ServiceProviderBase remove method publishes.

Call to undefined method Elasticsearch\ClientBuilder::defaultLogger()

Please be sure you include all the relevant information in your issue so we can help you:

  • steps taken to reproduce your issue
  • your configuration file(s), where relevant
  • a copy of your Models that use or extend this package (just the relevant parts!)
  • any other code we might need to help

The new version of elasticsearch 6.5 client library released. After installing i received the below error.

Call to undefined method Elasticsearch\ClientBuilder::defaultLogger()

elasticsearch 6.5 has some breaking changes: https://github.com/elastic/elasticsearch-php/pull/879/files.

Package guzzle/guzzle is abandoned

Title says it all. Following the guidelines we get:
Package guzzle/guzzle is abandoned, you should avoid using it. Use guzzlehttp/guzzle instead.

Using AWS instanceProfile

Hi,
I have an issue using the package in AWS.
What if I don't have the key and the secret and I have to use the instanceProfile?
Laravel allows using the key "credentials" for the S3 configuration in the config/filesystem.php file, but I'm not able to do the same with this package.

<?php
// config/filesystem.php
$provider = Aws\Credentials\CredentialProvider::instanceProfile();
$memoizedProvider = Aws\Credentials\CredentialProvider::memoize($provider);

return [
.....
's3' => [
    'driver' => 's3',
    'key' => null,
    'secret' => null,
    'credentials' => $memoizedProvider,
    'region' => env('AWS_DEFAULT_REGION'),
    'bucket' => env('AWS_BUCKET'),
    'url' => env('AWS_URL')
]

Can you add a 'aws_credentials' parameter so I can use the instanceProfile?
How can I solve this issue? Can you suggest another way?

Thank you
Giorgio

ErrorException Cannot Redeclare Class ElasticSearch because the name is already in use When Running API Test Lumen

Hi I've installed this package for my Lumen Project. It's perfectly working but not when I run my API Test. I got some exception. I tried looking on LumenServiceProvider.php and I think the line with

class_alias('\Cviebrock\LaravelElasticsearch\Facade', 'Elasticsearch');

is what is causing.

Reproduce Issue

  • Installed the package in my Lumen Project.
  • Tried Running API Test and encountered the error.

Any suggestion on how can I fix this?

Port parameter is not setting while creating GuzzleHttp\Psr7\Uri in factory.php

Env

AWS_ACCESS_KEY_ID=****
AWS_SECRET_ACCESS_KEY=****
AWS_REGION=eu-central-1
AWS_ELASTICSEARCH_ENABLED=true
ELASTICSEARCH_HOST=https://vpc-test-****.eu-central-1.es.amazonaws.com
ELASTICSEARCH_PORT=9200
ELASTICSEARCH_SCHEME=https
ELASTICSEARCH_USER=
ELASTICSEARCH_PASS=

Usage

$data = [
        'body' => [
        ],
        'index' => 'products',
        'type' => '_search',
    ];
    $return = Elasticsearch::index($data);

Response

"exception" => GuzzleHttp\Exception\RequestException {#325 ▼
    -request: GuzzleHttp\Psr7\Request {#322 ▶}
    -response: null
    -handlerContext: array:30 [▼
      "errno" => 60
      "error" => ""
      "appconnect_time" => 0.0
      "url" => "https://vpc-test-****.eu-central-1.es.amazonaws.com/products/_search"
....

"url" => "https://vpc-test-****.eu-central-1.es.amazonaws.com/products/_search"
As it can be understood from the error output, the port is not exist

current Factory.php

$psr7Request = new \GuzzleHttp\Psr7\Request(
                        $request['http_method'],
                        (new \GuzzleHttp\Psr7\Uri($request['uri']))
                            ->withScheme($request['scheme'])
                            ->withHost($request['headers']['Host'][0]),
                        $request['headers'],
                        $request['body']
                    );

Fix Factory.php

$psr7Request = new \GuzzleHttp\Psr7\Request(
                        $request['http_method'],
                        (new \GuzzleHttp\Psr7\Uri($request['uri']))
                            ->withScheme($request['scheme'])
                            ->withPort($host['port'])
                            ->withHost($request['headers']['Host'][0]),
                        $request['headers'],
                        $request['body']
                    );

Fxied Response

"exception" => GuzzleHttp\Exception\RequestException {#325 ▼
    -request: GuzzleHttp\Psr7\Request {#322 ▶}
    -response: null
    -handlerContext: array:30 [▼
      "errno" => 60
      "error" => ""
      "appconnect_time" => 0.0
      "url" => "https://vpc-test-****.eu-central-1.es.amazonaws.com:9200/products/_search"
....

have you ever seen this problem? How can fix it?

Laravel 6 update

When try to update project to laravel 6.
Problem 1
- cviebrock/laravel-elasticsearch 3.6.0 requires illuminate/support ~5.5.0|

InvalidArgumentException Elasticsearch connection [] not configured.

Hello,
I tried looking through the docs, closed issues and every config permutation I could think of and still can't resolve this error.

Using package v2.0.0, Laravel 5.5.23, Elasticsearch 6.0.0
The error is being thrown by \vendor\cviebrock\laravel-elasticsearch\src\Manager.php line 108.

.env has the following variables set:

ELASTICSEARCH_HOST
ELASTICSEARCH_PORT
ELASTICSEARCH_SCHEME
ELASTICSEARCH_USER
ELASTICSEARCH_PASS

config\app.php has:

'providers' => [
. . .
/* Package list */
Cviebrock\LaravelElasticsearch\ServiceProvider::class
],
'aliases' => [
. . .
'Elasticsearch' => Cviebrock\LaravelElasticsearch\Facade::class,
],

ElasticController.php is:

<?php

namespace App\Http\Controllers;

use App\Dashboard;
use Carbon\Carbon;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\Request;
use Illuminate\Http\Response;

class ElasticController extends Controller {

	public function index(Request $request) {
		$return = \Elasticsearch::ping();

		return view('welcome', compact('return'));
	}
}

How to use

Hello, thank you for taking the time to make this package but it seems many of us are having a hard time using this package. The other ones seems abandonned.

Your read me for some how has never used ES is not easy to grasp. We do not know where to execute the code. The install instructions are good, thanks for that, but not the usage.

Where do we put the indexing code? I have no idea what the type and index is, can you not just do a quick example with a sample model and show us?

That would be highly appreciated. Thanks.

New release

It'd be great if a new release was tagged to allow resolving the client through DI :)

integrating with logstash

i want to know if i can integrate my laravel logs in logstash with this package or not because it says nothing about logstash

AWS authentication error (signature)

I'm trying to connect to an AWS ElasticSearch service instance and have configured the AWS environment variables as shown in the docs:

AWS_ELASTICSEARCH_ENABLED=true 
AWS_REGION=eu-west-2 
AWS_ACCESS_KEY_ID=xxxxxxx
AWS_SECRET_ACCESS_ID=xxxxxxxx

However, I'm still getting this error:

[Elasticsearch\Common\Exceptions\Forbidden403Exception] {"message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details."}

Do you know what might be causing this?

The AWS user I am using the key ID and secret access key from has the following IAM policy attached to it:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "es:*"
            ],
            "Effect": "Allow",
            "Resource": "*"
        }
    ]
}

The ElasticSearch resource itself has this security policy:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": "es:*",
      "Resource": "arn:aws:es:eu-west-2:123456789:domain/xxx-xxx/*",
      "Condition": {
        "IpAddress": {
          "aws:SourceIp": "13x.xxx.xxx.xxx"
        }
      }
    }
  ]
}

Whoops! There was an error.

I see the message that "No alive nodes found in your cluster".

Please tell me about step-by-step installation and setup. (T_T)

Somebody help me! I'm a Elasticsearch starter.

========================
my ".env" file.

ELASTICSEARCH_HOST=mydomain.test
ELASTICSEARCH_PORT=9200
ELASTICSEARCH_SCHEME=http
ELASTICSEARCH_USER=
ELASTICSEARCH_PASS=

========================
my "router.php" file.

Route::get('/user/id/1', function () { 
  $data = [ 
    'body' => [ 
      'testField' => 'abc'
    ],
    'index' => 'my_index',
    'type' => 'my_type',
    'id' => 'my_id',
  ];

  Elasticsearch::index($data);
});

in homestead 7.9 of laravel 5.6

Doesn't read .env config

Just installed cviebrock from packalyst with this:

composer require cviebrock/laravel-elasticsearch

This is my .env file

ELASTICSEARCH_HOST=192.168.1.142
ELASTICSEARCH_PORT=9200
ELASTICSEARCH_SCHEME=http
ELASTICSEARCH_USER=
ELASTICSEARCH_PASS=

I don't have user and pass.
Actually I'm learning singleton pattern so I have to extends vendor file to one class and then to other class because my project needs,

First I would like to know how have I to set setHosts() method, I writed this ['192.168.1.142:9200'] which works well, but is not the .env file supposed to configure that? because if I do not overwrite or use method setHosts(). That's why I used setHosts() method. If i don't do this the project is connected to localhost:9200, and don't want it, also I would like to know how to set a different port.

Thanks you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.