Cake\ElasticSearch\Query::select PHP Method

select() public method

Calling this function multiple times will append more fields to the list of fields to be selected from _source. If true is passed in the second argument, any previous selections will be overwritten with the list passed in the first argument.
public select ( array $fields, boolean $overwrite = false )
$fields array The list of fields to select from _source.
$overwrite boolean Whether or not to replace previous selections.
    public function select(array $fields, $overwrite = false)
    {
        if (!$overwrite) {
            $fields = array_merge($this->_parts['fields'], $fields);
        }
        $this->_parts['fields'] = $fields;
        return $this;
    }