2
votes

How to enable dynamic scripting via symfony config?

I have simply multiply 2*2 but it can't works.

curl -XGET 'http://localhost:9200/app/user/_search' -d '{
    "script_fields" : {
        "test1" : {
            "script" : "2 * 2"
        }
    }
}'

File: config.yml

fos_elastica:
    clients:
        default: { host: localhost, port: 9200 }
    indexes:
        app:
            types:
                user:
                    mappings:
                        name: ~
                        pin: {type: geo_point}                        
                    persistence:
                        # the driver can be orm, mongodb, phpcr or propel
                        # listener and finder are not supported by
                        # propel and should be removed
                        driver: orm
                        model: AppBundle\Entity\User
                        provider: ~
                        listener: ~
                        finder: ~
1

1 Answers

1
votes

You should add followings to your configuration:

script.inline: true
script.indexed: true

For more information: https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html#enable-dynamic-scripting