Support the ongoing development of Laravel.io →
Eloquent IOC Packages

Windows 10, OpenServer, Laravel 4.2, Elasticsearch 1.0

Controller:

    public function searchUser()
    {
        $elastic = app()->make(App\Services\Elastic::class);
        $query = [
            'multi_match' => [
                'query' => 'Wood',
                'fuzziness' => 'AUTO',
                'fields' => ['username', 'email'],
            ],
        ];
        $parameters = [
            'index' => 'lara4',
            'type' => 'user',
            'body' => [
                'query' => $query
            ]
        ];
        $response = $elastic->search($parameters);
        dd($response);

ERROR

Elasticsearch \ Common \ Exceptions \ Curl \ CouldNotConnectToHost
Failed to connect to localhost port 9200: Connection refused
Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

ElBonBon elbonbon Joined 23 Apr 2017

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.