yii\elasticsearch\ActiveQuery::column PHP Method

column() public method

public column ( $field, $db = null )
    public function column($field, $db = null)
    {
        if ($field == '_id') {
            $command = $this->createCommand($db);
            $command->queryParts['fields'] = [];
            $command->queryParts['_source'] = false;
            $result = $command->search();
            if (empty($result['hits']['hits'])) {
                return [];
            }
            $column = [];
            foreach ($result['hits']['hits'] as $row) {
                $column[] = $row['_id'];
            }
            return $column;
        }
        return parent::column($field, $db);
    }