protected function extractCompletions($response)
    {
        $aggregations = isset($response['aggregations']) ? $response['aggregations'] : [];

        return array_map(function ($option) {
            return $option['key'];
        }, $aggregations['autocomplete']['buckets']);
    }
protected function extractCompletions($response)
    {
        $aggregations = isset($response['aggregations']) ? $response['aggregations'] : [];

        return array_map(function ($option) {
            return $option['key'];
        }, $aggregations['autocomplete']['buckets']);
    }
protected function extractCompletions ( $ response ) { $ aggregations = isset ( $ response [ 'aggregations' ] ) ? $ response [ 'aggregations' ] : [ ] ; return array_map ( function ( $ option ) { return $ option [ 'key' ] ; } , $ aggregations [ 'autocomplete' ] [ 'buckets' ] ) ; }
Extract autocomplete options

@param $response
@return array
Extract autocomplete options