Skip to content

1.2

Choose a tag to compare

@floriansemm floriansemm released this 01 Nov 17:48
· 391 commits to master since this release
  • new annotation option index for @Document
   /**
    * @Solr\Document(index="core0")
    */
    class SomeEntity
    {
        // ...
    }
  • remove clients options from configuration:
  • costum queries in repositories by @frne
class ArticleRepository extends Repository
{
    /**
     * @param string $search
     * @param int $limit
     * @param int $offset
     * @return Article[]
     */
    public function findFulltextSearch($search, $limit = 10, $offset = 0)
    {
        $this->hydrationMode = HydrationModes::HYDRATE_DOCTRINE;

        $query = $this->solr->createQuery($this->entity);
        $query->setUseAndOperator(false);
        $query->setRows($limit);
        $query->setStart($offset);
        $query->setUseWildcard(true);

        $query->addSearchTerm('id', $search);
        $query->addSearchTerm('author', $search);
        $query->addSearchTerm('title', $search);
        $query->addSearchTerm('content', $search);

        return $this->solr->query($query);
    }
}