I installed FOSElasticaBundle on Symfony2 to find data on elasticsearch. I followed the instruction, but I have an error and I don't know how to deal with it. The error is as follows:
Notice: Undefined index: bluecoat-syslog
500 Internal Server Error - ContextErrorException
Stack Trace
in vendor/friendsofsymfony/elastica-bundle/Transformer/ElasticaToModelTransformerCollection.php at line 56 -
$transformed = array();
foreach ($sorted as $type => $objects) {
* $transformedObjects = $this->transformers[$type]->transform($objects);
$identifierGetter = 'get'.ucfirst($this->transformers[$type]->getIdentifierField());
$transformed[$type] = array_combine(
array_map(
my controller
public function reportAction(Request $request)
{
$finder = $this->container->get('fos_elastica.finder.log');
$results = $finder->find('ERROR');
$parameters = array("results" => $results);
return $this->render('MyBundle:Core:report.html.twig', $parameters);
}
my config.yml
fos_elastica:
clients:
default: { host: localhost, port: 9200 }
indexes:
log:
client: default
index_name: log-2015.04.20
finder: ~
types:
bluecoat-syslog:
mappings:
message: ~
the version of the bundle is:
FOSElasticaBundle 3.1.x
Regards and thanks!