FOSElasticaBundle映射数组

时间:2016-02-08 13:59:29

标签: php symfony elasticsearch foselasticabundle

我尝试将映射字段添加到elastica

映射配置:

persistence:
                driver: orm
                model: PlaceBuundle\Entity\Place
                finder: ~
                provider: ~
                listener: ~

.....


                activePortals :
                      type: object
                      properties :
                          id:
                              type: integer
                  portalsSort:
                      type: object
                      properties:
                          id: ~
                          value: ~  
实体

中的

public function getPortalsSort(){

        return array(
            array('id'=>1,'value'=>10)
        );

    }

错误

 [Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException]                                       
  Cannot read property "id" from an array. Maybe you intended to write the property path as "[id]" instead.

没有类型:array

映射数组值的最简单方法是什么?

0 个答案:

没有答案