code: 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;
      }
docs: Execute the query and get all items.
  
  @param QueryBuilder|array $query
  @return Collection|static[]