I installed ElasticSearch 6 with their Docker image and everything work well.
Then I installed and configured FOSElastica like the doc said.
This is the following config of fos_elastica
fos_elastica:
clients:
default: { host: '%env(ELASTICSEARCH_HOST)%', port: '%env(ELASTICSEARCH_PORT)%' }
serializer:
serializer: jms_serializer
indexes:
app:
client: default
types:
user:
serializer:
groups: [elastica]
persistence:
driver: orm
model: AppBundle\Entity\User
provider: ~
listener: ~
finder: ~
And the model of my User entity to give the elastica serializer group to some field
AppBundle\Entity\User:
exclusion_policy: ALL
properties:
firstname:
expose: true
groups: [elastica, list, details]
lastname:
expose: true
groups: [elastica, list, details]
locale:
expose: true
groups: [elastica, details]
The serializer is working well for my API and is well configurated
jms_serializer:
metadata:
auto_detection: true
directories:
AppBundle:
namespace_prefix: 'AppBundle'
path: '%kernel.project_dir%/config/serializer'
When I'm trying to populate ElasticSearch I get, I think a bad serialization error
In Http.php line 181:
[Elastica\Exception\ResponseException]
Malformed action/metadata line [3], expected START_OBJECT but found [VALUE_STRING]
I tried to set field typing using properties.type config in the fos_elastica configuration without success.
I tried with another entity and I get the same error.
I have already work with FOSElasticaBundle ~1year ago on the same project and population was working...
I didn't success to find where is the problem, if there is a JMSSerializer/FOSElastica bug or a misconfig
Did I miss something in the configuration ? Do you already had this issue ?