symfony - FosElasticaBundle: define mapping for GUID / UUID fields -
how define mappings in config_yml if entities uses guid field type identifier?
details
i have project symfony 2.7.3 , foselasticabundle 3.1.4.
i have configured mapping , works fine when use populate command or if edit existing entity; when creating new entity exception
"expected simple value field [_id] found [start_object]]"
checking json response have noticed _id set empty object ..."_id":{}...
.
the uuid class has __tostring method expect should trick, missing something.
current mappings
fos_elastica: clients: default: { host: %elasticsearch_host%, port: %elasticsearch_port%, logger: true } indexes: app: types: user: mappings: name: ~ surname: ~ persistence: driver: orm model: appbundle\entity\user provider: ~ listener: ~ finder: ~
thank you.
there no specific mappings uuid/guid fields.
the identifier retrieved using standard symfony property accessor, solution problem change getid()
method in entity, , make cast string be
public function getid() { return (string)$this->id; }
Comments
Post a Comment