public static function all($query = [])
    {
        if ($query instanceof QueryBuilder) {
            $query = $query->build();
        }
        $collection = collect();
        static::map($query, function (ElasticsearchModel $document) use ($collection) {
            $collection->put($document->getId(), $document);
        });
        return $collection;
    }