FOSElasticaBundle icon indicating copy to clipboard operation
FOSElasticaBundle copied to clipboard

Populate uses serializer in all types and ignores "properties"

Open omar331 opened this issue 7 years ago • 2 comments

Hello,

I have an application that indexes multiple entities. Some of the are intented to be indexed using jms serializer, other I would like to be indexed by mapping in "properties" property in the type definition.

But when I set the serializer at root node, the definitions at "properties" are ignored and the populate command uses only the serializer.

The configurations are

fos_elastica:
    clients:
        default: { host: elasticsearch, port: 9200 }
    serializer:
        serializer: jms_serializer
    indexes:
        contratos:
            finder: ~
            types:
                produto_empresa:
                    serializer:
                        groups: [elastica]
                        version: '1.1'
                        serialize_null: true
                    persistence:
                        driver: orm
                        model: Templum\ClienteBundle\Entity\ProdutoEmpresa
                        provider: ~
                        finder: ~
        organizacao_produto:
            finder: ~
            settings:
                index:
                    analysis:
                        analyzer:
                            name_analyzer:
                                type: custom
                                tokenizer: standard
                                filter: [standard, lowercase, asciifolding, elision]
            types:
                organizacao_produto:
                    properties:
                        name_suggest:
                            type: completion
                            analyzer: name_analyzer
                            search_analyzer: name_analyzer
                        id:
                            type: keyword
                    persistence:
                        driver: orm
                        model: Templum\ClienteBundle\Entity\UnidadeNegocioProduto
                        listener: ~
                        finder: ~

Index contratos is indexed perfectly using serializer. But organizacao_produto is intended to use definitions in properties but it's using the serializer instead.

Any advice?

omar331 avatar Oct 10 '18 15:10 omar331

Hello,

This issue is over a year old, but I recently encountered the exact same problem.

I have 2 different types, each in its own index. I used to only have one using a ModelToElasticaTransformer, which was working just fine. But when I enable the serializer in order to use it only for my second type, it is also used for the first.

Is there any update concerning this subject?

Thanks in advance

XavierSiraudin avatar Feb 19 '20 10:02 XavierSiraudin

seems this issue still exists for newer version of the bundle

eradionov avatar Apr 15 '22 10:04 eradionov