src/ElasticsearchModel.php
public static function search($query = [])
    {
        if ($query instanceof QueryBuilder) {
            $query = $query->build();
        }
        $model = static::createInstance();
        return $model->_dal->search($query);
    }
public static function search($query = [])
    {
        if ($query instanceof QueryBuilder) {
            $query = $query->build();
        }
        $model = static::createInstance();
        return $model->_dal->search($query);
    }
Execute the query and get the result.

@param QueryBuilder|array $query
@return ElasticsearchCollection|static[]