From 6dad59d1496bfead9022fff248b345ecd3ed319a Mon Sep 17 00:00:00 2001 From: Tarasovych Date: Thu, 30 May 2019 00:51:48 +0300 Subject: [PATCH] Update setup.md (#1525) Add info about how to create more than one type for Elasticsearch 6.x --- doc/setup.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/doc/setup.md b/doc/setup.md index fb0dc4f28..b06991e98 100644 --- a/doc/setup.md +++ b/doc/setup.md @@ -105,6 +105,26 @@ fos_elastica: Each defined type is made available as a service, and in this case the service key is `fos_elastica.index.app.user` and is an instance of `Elastica\Type`. +If you are using Elasticsearch 6.x, you have to create separate index for each type: +```yaml +fos_elastica: + indexes: + app_user: + types: + user: + properties: + username: ~ + firstName: ~ + lastName: ~ + email: ~ + app_post: + types: + post: + properties: + title: ~ + content: ~ +``` + FOSElasticaBundle requires a provider for each type that will notify when an object that maps to a type has been modified. The bundle ships with support for Doctrine objects.