Questions tagged [foselasticabundle]

FOSElasticaBundle - Elasticsearch PHP integration for your Symfony2 project using Elastica.

Elasticsearch client is comparable to a database connection. Most of the time, you will need only one.

Elastica can handle objects instead of data arrays if a serializer callable is configured

Elasticsearch index is comparable to Doctrine entity manager. Most of the time, you will need only one.

Elasticsearch type is comparable to Doctrine entity repository.

If you are using the JMSSerializerBundle for serializing objects passed to elastica you can define serializer groups per type.

241 questions
2
votes
1 answer

Range Filter Query with elasticsearch in a symfony2 project

$mainQuery = new \Elastica\Query\BoolQuery(); $rangeFilter = new Filtered( $mainQuery, new Range('price', array( 'gte' => $min, 'lte' => $max )) ); $data = $finder->search($rangeFilter); In my controller Action, I am…
webgoesviral
  • 345
  • 2
  • 8
2
votes
1 answer

How to create a custom transformer from Elastic result to Doctrine entity

tl;dr How to extend / override the base transformer from Elastic result to Doctrine entity in FosElasticaBundle? Details I'd like to change the transform method in FOS\ElasticaBundle\Doctrine\AbstractElasticaToModelTransformer so that I can add a…
Francesco Abeni
  • 4,190
  • 1
  • 19
  • 30
2
votes
1 answer

FOSElasticaBundle and SoftDeletable Doctrine not working very well

I am currently using FOSElasticaBundle in my projects and the entities that is to be searched is using softdeletable . It seems that this is not going very well since when the entity is softdeleted the index on elastic search is not removed.…
adit
  • 32,574
  • 72
  • 229
  • 373
2
votes
1 answer

Elastica with FOS : ElasticsearchIllegalArgumentException

In my symfony2 / doctrine 2 application, I get an error when running fos:elastica:populate : [Elastica\Exception\Bulk\ResponseException] Error in one or more bulk request actions: index: /foodmeup/offer/4 caused MapperParsingException[failed to…
Sébastien
  • 5,263
  • 11
  • 55
  • 116
2
votes
2 answers

Elastica Client with cluster

I have an Elasticsearch cluster with Compose.io but I can't connect with Elastica Client. This is my configuration : $elasticaClient = new \Elastica\Client(array( 'servers' => array( array('host' =>…
Siol
  • 311
  • 8
  • 21
2
votes
2 answers

Unable to set up Parent Child with FOSElasticaBundle

I am trying to setup a parent child relationship and I can't seem to get the mapping config right. I'm using Symfony2.5, FOSElastica 3.0.9 and Elasticsearch 1.4.4 Here is the relevent section from my mapping: # fos elastica fos_elastica: …
Ben Stinton
  • 411
  • 2
  • 8
  • 17
2
votes
2 answers

FOSElastica Bundle : retrieving highlights for results

I'm trying to have highlights returned with a global index search with the FOSElastica Bundle. I have a global index finder in my configuration (yml file): fos_elastica: clients: default: { host: %elastic_host%, port: %elastic_port% } …
tchap
  • 3,412
  • 3
  • 29
  • 46
2
votes
2 answers

Indexing calculated field with elastic search (FOSElasticaBundle) on symfony2

I have an "article" entity, that have a one to many relation with the entity "rate". My articles are already indexed. I want to add to index the rate average for the article (calculated with the "rate" entities related to the article), and i don't…
user3328275
  • 53
  • 1
  • 6
2
votes
3 answers

Symfony 2.4 execute Command from Controller

I want to execute the command fos:elastica:populate from my controller. I tried that code but it doesn't work, i get error = 1 the var_dump show "" $command = 'fos:elastica:populate'; $app = new…
Sancho
  • 1,288
  • 2
  • 25
  • 50
1
vote
1 answer

Query an array that contain string with terms

I want filter result from Elasticsearch where array of strings contain one of specific string value: This is current json result, no filtered : { "id": 1, "title": "Title", "tags": [ "tag filter" …
orianFAW
  • 13
  • 2
1
vote
1 answer

how to use scroll in foselasticabundle?

I would like to know how can i set scroll in foselasticabundle? I have this code $res = $this->commentIndex->createSearch($query, ['scroll' => '1m']); $res->addType('reading'); $res->scroll(); I know Im already close getting the result of my…
user3818576
  • 2,979
  • 8
  • 37
  • 62
1
vote
0 answers

How to do FOSElasticaBundle bulk index?

It seems that the default doctrine listener used by FOSElasticaBundle does not support bulk index by default. I have an application where I want to add support for more complex search queries through ElasticSearch. The search engine only will…
1
vote
1 answer

FOS Elastica: How can I populate an index without Doctrine

I use FOS Elastica bundle in my Symfony application but I am not using Doctrine. I try to populate the Elasticsearch with a custom provider. Here is my code. # config/packages/fos_elastica.yaml fos_elastica: clients: default: { url:…
Jayster
  • 61
  • 6
1
vote
0 answers

Symfony 4.2.8 : Can't connect to ES 7.10 through the fos:elastica:populate command

I encounter a problem in my production site in Symfony 4.2.8 (yes I know...). When I try to launch a bin/console fos:elastica:populate or bin/console fos:elastica:reset the console crash (with -vvv option) : Exception trace: () at…
1
vote
0 answers

Symfony FOSElasticaBundle configuration

I am having a problem. Symfony: 4.4 Elasticsearch: 7.6.1 FOSElasticaBundle: 5.1 PHP: 7.2.26 My configuration: fos_elastica: clients: default: { url: '%env(ELASTICSEARCH_URL)%' } indexes: app: finder: ~ …
Murat SAÇ
  • 396
  • 1
  • 3
  • 13