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
14
votes
7 answers

Symfony2 FOSElasticaBundle update index for all entities related to the entity updated

I'm using FOSElasticaBundle and Doctrine in my project, and my code works for the selective index update using the Doctrine lifecycle events. The issue I come up against is if I an update a related entity separately. For example a person may be…
Ben Stinton
  • 411
  • 2
  • 8
  • 17
12
votes
2 answers

ElasticSearch RoutingMissingException

I'm trying to populate objects having parent-child relation, but get an error: [Elastica\Exception\ResponseException] RoutingMissingException[routing is required for [myindex]/[comment]/[12345]] Excerpt from type conf: article: _source: …
JohnSmith
  • 436
  • 5
  • 17
9
votes
1 answer

FOSElasticaBundle and Doctrine Hydration

I'm busy checking out elasticsearch for a new project that I'm starting on. I'm currently running Symfony2.5, with the latest FOSElasticaBundle and all that. I'm doing some benchmarks into performance of the bundle (I know elastic in itself is…
iLikeBreakfast
  • 1,545
  • 23
  • 46
7
votes
0 answers

FosElasticaBundle Dynamic Index?

I'm building a multi-tenant application with multiple indexes, one index per tenant. Just wondering if there has been any work on allowing the index names to be changed dynamically?
Ricardo
  • 2,427
  • 19
  • 35
7
votes
1 answer

Foselasticabundle : How to add a script to FunctionScore in a query ? Elastica

I need to add a functionScore to my query to define a specific relevance for my results. Here is my working code : $query = new BoolQuery(); $filters = new BoolFilter(); $query = new Query\Term(); $query->setTerm($field, $value); …
GregOs
  • 403
  • 3
  • 13
6
votes
2 answers

FosElasticaBundle: multiple types in one index

I need to build a multiple-entity search. I don't want every T1, then every T2. When I use fos:lastica:populate, I get an error: Rejecting mapping update to [search_dev] as the final mapping would have more than 1 type: [t1, t2] My…
Sancho
  • 1,288
  • 2
  • 25
  • 50
6
votes
1 answer

FOSElasticaBundle for symfony 3?

I'm looking to integrate the FOSElasticaBundle into my symfony 3 project. Currently this bundle doesn't support symfony 3. I was ondering what I could do to still implement it?
SnelleJelle
  • 933
  • 5
  • 18
  • 35
6
votes
2 answers

Error in ResponseExeption while populating FOSElasticaBundle/Symfony2

I am trying to get FOSElasticaBundle to work. ElasticSearch Instance is running on localhost:9200 and responding. I followed each step in the docs https://github.com/FriendsOfSymfony/FOSElasticaBundle/blob/master/Resources/doc/setup.md but at the…
RoyRobsen
  • 457
  • 1
  • 9
  • 20
6
votes
2 answers

FOS Elastica -- getting string representation of query

I am unit-testing a repository that uses FOS Elastica and I was wondering if anyone knows how to get the string version of a query, rather than in array form. Here is my repository method: /** * Creates query object by either first or last…
Byte Lab
  • 1,576
  • 2
  • 17
  • 42
5
votes
3 answers

Elasticsearch foselastica repository and groupBy

Hello I have a problem.. I have my elastica repository namespace XX\xxx; use FOS\ElasticaBundle\Repository; class TestRepository extends Repository { public function getExamples($argOne, $argTwo) { $query = new BoolQuery(); $matchOne =…
Jack Red
  • 51
  • 2
5
votes
1 answer

Order by timeUpdated, if exists, otherwise timeCreated

I have 2 fields in an elastic type, namely timeCreated and timeUpdated. Now my business case is that we should always order by timeUpdated, unless it's null (or non-existent), which then obviously leaves us with timeCreated, which is always set.…
iLikeBreakfast
  • 1,545
  • 23
  • 46
5
votes
1 answer

How to configure correctly FOS Elastica analyzers and filters?

In my symfony2 application, I am using FOS Elastica bundle to perform searches. I have tried to set up analyzers and filters but it seems they just have no effect. For instance, if I search for the word 'cake', the objects containing the sentence…
Sébastien
  • 5,263
  • 11
  • 55
  • 116
5
votes
3 answers

Populating FosElasticaBundle running out of php memory, possible memory leak?

I've installed FOSElasticaBundle and have it working with a cross section of my data. My problem arises in that I have about 14m rows that I need to use to build an index. I ran the populate command and after about 6 hours yesterday it errored out…
Pez
  • 1,251
  • 16
  • 32
4
votes
0 answers

Validate ElasticSearch data with the mapping

For unit testing purpose, I would like to reuse the ElasticSearch mapping in order to validate a sample of data and make sure the structure remains consistent. Is there a solution like what we could have to validate a json schema ? I don't want to…
Fabien Salles
  • 1,101
  • 15
  • 24
4
votes
0 answers

Elasticsearch with symfony - Error populate command softdeletable entity

I use the symfony bundle Foselasticabundle and i am facing a problem. I have an entity (B) which can be deleted via gedmo softdeleteable. I created the mapping, via the YAML file, and when I execute the following command fos:elastica:populate i get…
flev
  • 37
  • 3
1
2 3
16 17