The notes below are for those who use FOSElasticaBundle in their projects. You'll find an example for each points below in this blog.


Example config

For more information and options available, check Configuration.php.

Bare minimum

driver: orm
model: Your/AppBundle/Entity/User
finder: ~
provider: ~
listener: ~


driver: The driver you are using.
model: The entity class that you want to create an index from.
finder: Used to query ES finder. No need to touch this.
provider: Used to create a custom repository QueryBuilder (query_builder_method) that manually selects records from the DB to populate the index from. Or, we can populate index with the data coming from somewhere else rather than the database by using a custom provider class (service).
listener: Define how do you wish to update elasticsearch index after CRUD operations in DB.
model_to_elastica_transformer: Used to create a custom class which is used to populate/manipulate ES index creation.