Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 54 lines (44 sloc) 1.232 kb

Doctrine Search

Supported search engines

Todo convert this into items

  • SearchService
    • aggregates a ObjectManager instance: $searchManager = new SearchManager($objectManager);
    • supports direct API calls (Solr, Lucene, ... Adapter useable)
    • transforms returned ID"s via batch operation into objects
  • EventListener for indexing, new SearchIndexListener($backendAdapter);
  • uses ObjectManager::getClassMetadata() as the base structure
  • adds new Annotationen for more complexe configuration needs


namespace Entities;

use Doctrine\Search\Mapping\Annotation as Search;
use Doctrine\ORM\Mapping as ORM;

 * @ORM\Entity
 * @Search\Searchable
class Post
     * @var integer
     * @ORM\Id @ORM\GeneratedValue(strategy="AUTO")
    public $id;

     * @var string
     * @ORM\Column(type="string")
     * @Search\Field
    public $title;

     * @var string
     * @ORM\Column(type="text")
     * @Search\Field
     * @Search\SolrField
    public $content;
Jump to Line
Something went wrong with that request. Please try again.