Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
is there anyone use elasticsearch with docker,I can't get response with command docker run -itd -p 9200:9200 -p 9300:9300 --name elasticsearch -v /elasticsearch/data:/usr/share/elasticsearch/data --restart=always 45ff2ef9a219. My container is running but I can't use curl localhost:9200get the response.I got the question like that:
curl: (56) Recv failure: Connection reset by peer
@SenalChen does your ES interface binding match your setup? Take a look at network.host here: https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html
For local development in a trusted network, you might consider putting there.
As your problem is only focused on ES and not this project, you may have more luck in ES resources and community.
@mark-hygi ok I will try it,thank you very much!
Hi @mark-hygi, my configuration is network.host:,this is my config:
node.name: node-1
node.master: true
node.data: true
cluster.name: docker-application
http.port: 9200
discovery.zen.ping.unicast.hosts: ["localhost:9201", "localhost:9202"]
http.cors.enabled: true
http.cors.allow-origin: "*"

Hi,guys,does you know how to solve this:

org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Failed to create node environment
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-6.8.0.jar:6.8.0]
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-6.8.0.jar:6.8.0]
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.8.0.jar:6.8.0]
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.8.0.jar:6.8.0]
        at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.8.0.jar:6.8.0]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116) ~[elasticsearch-6.8.0.jar:6.8.0]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-6.8.0.jar:6.8.0]
Caused by: java.lang.IllegalStateException: Failed to create node environment
        at org.elasticsearch.node.Node.<init>(Node.java:299) ~[elasticsearch-6.8.0.jar:6.8.0]
        at org.elasticsearch.node.Node.<init>(Node.java:266) ~[elasticsearch-6.8.0.jar:6.8.0]
        at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:212) ~[elasticsearch-6.8.0.jar:6.8.0]
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.8.0.jar:6.8.0]
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.8.0.jar:6.8.0]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.8.0.jar:6.8.0]
        ... 6 more
Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data/nodes
        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:90) ~[?:?]
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) ~[?:?]
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116) ~[?:?]
        at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:389) ~[?:?]
        at java.nio.file.Files.createDirectory(Files.java:692) ~[?:?]
        at java.nio.file.Files.createAndCheckIsDirectory(Files.java:799) ~[?:?]
        at java.nio.file.Files.createDirectories(Files.java:785) ~[?:?]
        at org.elasticsearch.env.NodeEnvironment.lambda$new$0(NodeEnvironment.java:273) ~[elasticsearch-6.8.0.jar:6.8.0]
        at org.elasticsearch.env.NodeEnvironment$NodeLock.<init>(NodeEnvironment.java:206) ~[elasticsearch-6.8.0.jar:6.8.0]
        at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:270) ~[elasticsearch-6.8.0.jar:6.8.0]
        at org.elasticsearch.node.Node.<init>(Node.java:296) ~[elasticsearch-6.8.0.jar:6.8.0]
        at org.elasticsearch.node.Node.<init>(Node.java:266) ~[elasticsearch-6.8.0.jar:6.8.0]
        at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:212) ~[elasticsearch-6.8.0.jar:6.8.0]
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.8.0.jar:6.8.0]
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.8.0.jar:6.8.0]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.8.0.jar:6.8.0]
        ... 6 more

I tried https://www.elastic.co/guide/en/elasticsearch/reference/6.5/docker.html
Notes for production use and defaults, but still get this exception.Does anyone knows why?

Hello all,
Im getting error fileddata access on _uid is disallowed.
Kidly help
John Peter
search('')->get() returns empty where as search('')->raw() returns the elasticsearch response, please help
John Peter
  • search('*')
Wojciech Szczurek
@johnpeter.pondybiz_gitlab This is a bug, produces this error Method ScoutElastic\Builders\FilterBuilder::rule does not exist.
how to log query record :((
Wojciech Szczurek
@NominationP Privide logger in Elasticsearch config. ``
 * @param \Psr\Log\LoggerInterface $logger
 * @return $this
public function setLogger($logger)
    if (!$logger instanceof LoggerInterface) {
        throw new InvalidArgumentException('$logger must implement \Psr\Log\LoggerInterface!');

    $this->logger = $logger;

    return $this;
Halah AlMazrua
hello, I have a simple question, can I elasticsearch to 2 models ?
I'm new to elasticsearch, please excuse me
Zac Grierson
They guys new to setting this up was wondering if anyone could help me get the basics done?
arun nair

Hi I m newer in elastic search .. I got an error D:\xampp\htdocs\laraelastic>php artisan elastic:update-mapping "App\Book"

Elasticsearch\Common\Exceptions\BadRequest400Exception : {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Rejecting mapping update to [tutorial] as the final mapping would have more than 1 type: [authors, books]"}],"type":"illegal_argument_exception","reason":"Rejecting mapping update to [tutorial] as the final mapping would have more than 1 type: [authors, books]"},"status":400}

at D:\xampp\htdocs\laraelastic\vendor\elasticsearch\elasticsearch\src\Elasticsearch\Connections\Connection.php:624
620| $exception = new ScriptLangNotSupportedException($responseBody. $statusCode);
621| } elseif ($statusCode === 408) {
622| $exception = new RequestTimeout408Exception($responseBody, $statusCode);
623| } else {

624| $exception = new BadRequest400Exception($responseBody, $statusCode);
625| }
627| $this->logRequestFail($request, $response, $exception);

Exception trace:

1 Elasticsearch\Connections\Connection::process4xxError([])

2 Elasticsearch\Connections\Connection::Elasticsearch\Connections{closure}()

Please use the argument -v to see more details.

Book Model <?php

namespace App;
use ScoutElastic\Searchable;
use Illuminate\Database\Eloquent\Model;

class Book extends Model
use Searchable;

// We don't want to use timestamps in this tutorial
public $timestamps = false;
protected $indexConfigurator = TutorialIndexConfigurator::class;

// We don't analyze numbers, all text is in English
protected $mapping = [
'properties' => [
'id' => [
'type' => 'integer',
'index' => true
'title' => [
'type' => 'text',
'analyzer' => 'english'
'description' => [
'type' => 'text',
'analyzer' => 'english'
'year' => [
'type' => 'integer',
'index' => false
'author_id' => [
'type' => 'integer',
'index' => true
// Each book belongs to one author
public function author()
return $this->belongsTo(Author::class);

Evgeni Enchev

Hi all. I have the following issue:

  1. Standard laravel model with $mapping attribute, where the created_at field is set as ['type' => 'date','format' => 'yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis||date_optional_time']
  2. Next, I create an Index for that model:
    php artisan elastic:create-index --tenant=$domain App\Search\IndexConfigurators\ModelIndexConfigurator

However, until any data is imported into the index it's mapping, despite defined in the code, is not applied. This I verify in ES by accessing ES_URL/{index}/_mapping

Because of this, if I try any search with empty ElasticSearch index, I get the following:
query_shard_exception\",\"reason\":\"No mapping found for [created_at] in order to sort on\",\"index_uuid\":\"NFCAQ2oJTjqOjjtjEpQOSQ\",\"index\":\"INDEX_NAME\"}],\"type\":\"search_phase_execution_exception\"
Any idea how to apply index mapping at index creation and not first import?

Failed to execute git checkout '59cf9c8b9262ea81e097a7ab7483a17332c8ac21' -- && git reset --hard '59cf9c8b9262ea81e097a7ab7483a17332c8ac21' --

fatal: reference is not a tree: 59cf9c8b9262ea81e097a7ab7483a17332c8ac21

return this, why?
when i try compoer install
Utsav Shrestha
hello what is the difference between this package and https://github.com/elasticquent/Elasticquent
Fredrik Sundström

Hey! :)

If any authors are here, thanks for a good lib! It works really good for me.

I have a task I do not know how to complete. Tried googling it but I'm turning up nothing I can make sense of... Yes, I'm a beginner, sort of. :)

Anyway, I'm trying to use whereIn for recipe ingredients:

->whereIn('ingredients', $ingredients)

Where $ingredients obviously is an array, also, the field in the index is an array. Kinda like this:

->whereIn(['tomatoes', 'potatoes', 'cucumbers'], ['tomatoes', 'potatoes'])

I would like it to match all the ingredients in the array, tho. Now it'll show me results if one of the ingredients in the array matches anything in the array in the index, but I would like to force it to only show records that has all the ingredients I pass to it, in this example it has to have both tomatoes and potatoes.

Does anyone know how I can achieve this?

is this still support with laravel 6.5
Santosh Jung Shahi
can anyone help me in this issue?
Santosh Jung Shahi
Hi! I am currently migrating from Elasticquent (abandoned) to the bebenkoivan/scout-elasicsearch-driver.
I have a number of models that have relations of type "hasMany". For example a classified ad model can have any number of categories (just an example) associated with it, for which I use the Eloquent hasMany feature. I am not sure how to get this to work with this package. Any pointers on this?
Or would I be better off indexing the entire classified ad with all its child objects in a single document?... this would require a large rewrite of the code so this is not preferred..
I should note that the user has to be able to filter on the child models of the main object (classified ad)
Looks like this matches my usecase: babenkoivan/scout-elasticsearch-driver#91
will investigate further
Andrey Toropin
@babenkoivan Hello again! According to new ES breaking changes (https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html) like removal the ability to store several types in one index (ex. several tables from DB in one ES index), I'm looking for the best way to search across multiple types. Obvious option is: multi index search. But, as far as I know, your current extension version could not make multi index search request? And so, it cannot map results from DB source, because of _type. Any suggestions? Thank you!
@babenkoivan, merge this please, babenkoivan/scout-elasticsearch-driver#307
Rodrigo Galter
Bom dia pessoal, como faço pra usar a busca junto com ->whereHas() ?
Hi, recently started using this package for my site. I have about million records to index and I am using LengthAwarePaginator, but the thing is - I can set after search(... to ->take(Product::RESULT_LIMIT) (which is 600, in this case) and paginating it 24 records per page, but it always returns max_result_window ES setting which is, as default, 10000, yet, it I don't paginate it with Laravel, it returns the amount of ES indices I need (600). As I have read, you should use "size" to define the limit, but it is used with Laravel LApaginator which then messed it up and I have to end up putting dynamic numbers for "from" and "size" in the query, which defeats the purpose.
Any other way to set limited amount of returned indices from Elastic? Without the limit I get the error of "from + size is greater than the max_result_window...".
Thanks in advance

I want to use this package with my laravel nova site, but i can't figure out how to make it work ..
I followed the steps in README.md but I get no results when I search (using the nova search bar)

Can anyone help me please

Hello everyone.
I have a new force feedback steering wheel now
but there is no driver for it, so I want to develop a driver for it
please give me any idea, kindly~~~
Elasticsearch/Common/Exceptions/BadRequest400Exception with message '{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Rejecting mapping update to [dani_index] as the final mapping would have more than 1 type: [model_tests, dani_test]"}],"type":"illegal_argument_exception","reason":"Rejecting mapping update to [dani_index] as the final mapping would have more than 1 type: [model_tests, dani_test]"},"status":400}'
i have this error when i try insert fake data with factory
@babenkoivan please help
hello, everyone.