【问题标题】:fos elastica populate is looping foreverfos elastica populate 永远循环
【发布时间】:2015-03-26 15:33:48
【问题描述】:

我不知道 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 中没有实体,它只是用于记录用户搜索。

【问题讨论】:

  • 你可能需要分享你的 foselastica 配置
  • @DerickF 我用我的配置更新了

标签: symfony elasticsearch foselasticabundle


【解决方案1】:

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

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

我请求了带有修复的 git

【讨论】:

    猜你喜欢
    • 2021-11-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-30
    • 2017-10-12
    • 2021-11-18
    • 2018-05-30
    相关资源
    最近更新 更多