Command.php
public function suggest($suggester, $options = [])
    {
        if (empty($suggester)) {
            $suggester = '{}';
        }
        if (is_array($suggester)) {
            $suggester = Json::encode($suggester);
        }
        $url = [
            $this->index !== null ? $this->index : '_all',
            '_suggest'
        ];

        return $this->db->post($url, array_merge($this->options, $options), $suggester);
    }
public function suggest($suggester, $options = [])
    {
        if (empty($suggester)) {
            $suggester = '{}';
        }
        if (is_array($suggester)) {
            $suggester = Json::encode($suggester);
        }
        $url = [
            $this->index !== null ? $this->index : '_all',
            '_suggest'
        ];

        return $this->db->post($url, array_merge($this->options, $options), $suggester);
    }
public function suggest ( $ suggester , $ options = [ ] ) { if ( empty ( $ suggester ) ) { $ suggester = '{}' ; } if ( is_array ( $ suggester ) ) { $ suggester = Json :: encode ( $ suggester ) ; } $ url = [ $ this -> index !== null ? $ this -> index : '_all' , '_suggest' ] ; return $ this -> db -> post ( $ url , array_merge ( $ this -> options , $ options ) , $ suggester ) ; }
Sends a request to the _suggest API and returns the result
@param string|array $suggester the suggester body
@param array $options
@return mixed
@see http://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html
Sends a request to the _suggest API and returns the result