Exemple #1
0
 public function findBy(array $args)
 {
     $query = $this->solr->createQuery($this->entity);
     foreach ($args as $fieldName => $fieldValue) {
         $query->addSearchTerm($fieldName, $fieldValue);
     }
     return $this->solr->query($query);
 }
 public function testCreateQuery_ValidEntity()
 {
     $this->setupMetaFactoryLoadOneCompleteInformation();
     $solr = new SolrFacade($this->connectionFactory, $this->commandFactory, $this->eventManager, $this->metaFactory);
     $query = $solr->createQuery('FSBlogBundle:ValidTestEntity');
     $this->assertTrue($query instanceof SolrQuery);
     $this->assertEquals(4, count($query->getMappedFields()));
 }