FriendsOfSymfony / FOSElasticaBundle

Elasticsearch PHP integration for your Symfony project using Elastica.
http://friendsofsymfony.github.io
MIT License
1.24k stars 795 forks source link

How can i specify the field type when dynamically updating an Elasticsearch index using the PostTransformEvent in Symfony with ElasticaBundle? #1929

Open cfftony opened 1 year ago

cfftony commented 1 year ago

How can i specify the field type when dynamically updating an Elasticsearch index using the PostTransformEvent in Symfony with ElasticaBundle?

$document = $event->getDocument(); $object = $event->getObject(); $document->set('images', $value);

The type of 'images' is determined based on the given value by default. For example, if a string is provided, 'images' will be considered as text. However, if I want to use 'keyword,' how should I configure it?

thanks