0

Using elasticsearch-php on Laravel 5 through Shift31/laravel-elasticsearch (provides facade for elasticsearch-php). Hosting an ES instance on Facetflow.

config/elasticsearch.php:

return array(
    'hosts' => array(
        'https://[email protected]:443'
    )
);

WelcomeController.php:

public function elasticsearch()
{

    $searchParams['index'] = 'your_index';
    $searchParams['size'] = 50;
    $searchParams['body']['query']['query_string']['query'] = 'foofield:barstring';

    return Es::search($searchParams);
    // throws Authentication401Exception exception
}

This returns Authentication401Exception. My guess is the username is not passed to the Facetflow server, but I have not found a way to check if this is true.

The problem does not seem to be in the server's settings, because when I use plain curl, I get a 200 response:

public function justCurl()
{
    $ch = curl_init();

    // Now set some options (most are optional)

    // Set URL to download
    curl_setopt($ch, CURLOPT_URL, "https://[email protected]:443");

    // Download the given URL, and return output
    $output = curl_exec($ch);

    // Close the cURL resource, and free system resources
    curl_close($ch);

    return $output;
    // returns 200 response
}

How do I fix this issue?

1 Answer 1

0

Facetflow's blazing-fast customer support pointed out the issue here. Host was supposed to be marked as

'https://accessUsername:@ilovelasagna.east-us.azr.facetflow.io:443'

Note the colon after accessUsername.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.