代码之家  ›  专栏  ›  技术社区  ›  thuiban

fos elasticasearch无法识别的选项index_analyzer search_analyzer映射

  •  0
  • thuiban  · 技术社区  · 6 年前

    我被symfony错误阻止:

    下无法识别的选项“index_analyzer,search_analyzer,mappings” “fos-elastica.indexes.optro.types.technical”协助

    我使用symfony 3.4.11和fos elasticsearch 5.03。

    怎么了?文件缩进?
    配置文件的一部分:

    types:
      technical_assistance:
        index_analyzer: my_nGram_index_analyzer
        search_analyzer: my_nGram_search_analyzer
        mappings:
          subject: { boost: 2 }
          description: ~
          equipment_reference: ~
          filename: ~
          trackingNumber: ~
          requester:
            type: "object"
            properties:
              first_name: ~
              last_name: ~
          section:
            type: "object"
            properties:
              name: ~
              translatedNames: ~
          messages:
            type: "object"
            properties:
              content: { boost: 0.5 }
              filename: ~
        persistence:
          driver: orm
          model: Optro\HelpdeskBundle\Entity\TechnicalAssistance
          provider: ~
          listener: ~
          finder:
            service: optro.finder.raw.technical_assistance
    
    1 回复  |  直到 6 年前
        1
  •  1
  •   fxbt    6 年前

    必须为每个相关字段声明自定义分析器。据我所知,你不能在全球范围内宣布。

    types:
        technical_assistance:
             properties:
                 subject:
                     boost: 2
                     index_analyzer: my_nGram_index_analyzer
                     search_analyzer: my_nGram_search_analyzer
                 description:
                     index_analyzer: my_nGram_index_analyzer
                     search_analyzer: my_nGram_search_analyzer
                 ...