0

我不知道 fos elastica 发生了什么:

当我尝试索引我的实体时,如果显示以下结果:

hey@dotme:/var/www/v2-preprod/httpdocs/current# php app/console fos:elastica:populate
 0/438 [>---------------------------]   0%
%message%

第一个实体(这里有 438 个结果)被正确索引,但它永远不会进入下一个实体,所以我必须手动填充每个实体(并且每次都必须终止进程)

任何想法 ?

我设置了 jms 序列化程序以正确使用 fos elastica。

这是我的配置:

弹性搜索

fos_elastica:
clients:
    default: { host: localhost, port: 9200, logger: false }

serializer:
    callback_class: FOS\ElasticaBundle\Serializer\Callback
    serializer: serializer

indexes:
    recetas:
        client: default
        settings:
            index:
                analysis:
                    analyzer:
                        custom_search_analyzer:
                            type: custom
                            tokenizer: standard
                            filter   : [standard, lowercase, asciifolding]
                        custom_index_analyzer:
                            type: custom
                            tokenizer: standard
                            filter   : [standard, lowercase, asciifolding]
                    filter:
                        custom_filter:
                            type: "edgeNGram"
                            side: front
                            min_gram: 3
                            max_gram: 20
        types:
            Recipe:
                mappings: 
                    name: 
                        search_analyzer: custom_search_analyzer
                        index_analyzer: custom_index_analyzer
                        type: string
                    slug: 
                        search_analyzer: custom_search_analyzer
                        index_analyzer: custom_index_analyzer
                        type: string
                    country:
                        type: string
                    seen:
                        type: integer                        
                persistence:
                    driver: orm # orm, mongodb, propel are available
                    model:  recetas\AppBundle\Entity\Recipe\Recipe
                    provider: 
                        debug_logging: false
                    listener: ~
                    finder: ~
                serializer:
                    groups: [elastica]
            Ingredient:
                mappings:
                    name: 
                        search_analyzer: custom_search_analyzer
                        index_analyzer: custom_index_analyzer
                        type: string
                    slug: 
                        search_analyzer: custom_search_analyzer
                        index_analyzer: custom_index_analyzer 
                        type: string
                    seen:
                        type: integer
                persistence:
                    driver: orm # orm, mongodb, propel are available
                    model:  recetas\AppBundle\Entity\Recipe\Ingredient
                    provider:
                        debug_logging: false
                    listener: ~
                    finder: ~
                serializer:
                    groups: [elastica]
            Search:
                mappings:
                    value:
                        search_analyzer: custom_search_analyzer
                        index_analyzer: custom_index_analyzer
                        type: string
                    date:
                        type: date
                        format: basic_date_time

搜索类型没有持久性,因为 symfony 中没有实体,它只是用于记录用户搜索。

4

1 回答 1

0

好的,所以我找到了导致问题的原因:

fosElasticaBundle 中没有为批量大小设置默认值,因此填充函数中的索引循环永远循环。

我拉请求了带有修复的git

于 2015-03-30T07:20:34.420 回答