Пример #1
0
 /**
  * @param $element
  * @param $searchIndex
  */
 public function getTagsForElementAndSave($element, $searchIndex)
 {
     /*
      * We bound orm with ElasticSearch at this point. I could separate the logic but this
      * means that we will have logic duplication. Maybe this could be refactored in the future.
      */
     $elasticaDocument = $this->transformer->transform($element, array_flip(array_keys($this->config['filters']['facets'])));
     $searchIndex->setTags(serialize($elasticaDocument->getData()));
     $this->em->persist($searchIndex);
     $this->em->flush();
 }