Category : elastica

I’m indexing a list of schools, each one can offer courses in several languages. I’m using FOSElasticaBundle in a Symfony 4 project. This is my fos_elastica.yaml : fos_elastica: indexes: school_ndx: index_name: school_ndx types: etablissement: persistence: driver: orm model: AppEntitySchool properties: languages: { property_path: myFuncLanguages } And this is the myFuncLanguages : public function myFuncLanguages() { ..

Read more

Here is my code to make aggregations : public function getNbContributions(ParamFetcher $paramFetcher) { $index = $this->client->getIndex($this->container->getParameter(‘nuxeo_doc_index’)); $query = new ElasticaQuery(); if ($paramFetcher->get(‘periode’) != null) { $histogramInterval = ”; if (strtolower(trim($paramFetcher->get(‘periode’))) == ‘a’) { $histogramInterval = ‘year’; } else if (strtolower(trim($paramFetcher->get(‘periode’))) == ‘m’) { $histogramInterval = ‘month’; } else if (strtolower(trim($paramFetcher->get(‘periode’))) == ‘s’) { $histogramInterval = ..

Read more

I am using Elastica PHP client to request my Elasticsearch index in my symfony project. I want to log information about request sent (query data as json for example) So i inject my monolog logger (LoggerInterface extends) in constructor and __log() method is called in request automatically and request object passed to log function : ..

Read more