2013-04-29 60 views
0

我有用於Elasticsearch的附件插件來索引存儲在Document中的所有文件。我想排除存儲在_source中的文件內容。使用foqelasticabundle排除_source映射中的字段

我的配置文件看喜歡:

  document: 
       mappings: 
        id: { index: not_analyzed } 
        path: {} 
        name: { boost: 5} 
        file: 
         type: attachment 
         store: "yes" 
         fields: 
          title: { store : "yes" } 
          file : {term_vector: "with_positions_offsets", store: yes} 
         analyzer: standard 
         boost: 2 

       persistence: 
        driver: orm 
        model: ACF\CaseBundle\Entity\Document 
        listener: 
        finder: 
        provider: 
         batch_size: 100 

       _source: 
        excludes: 
         file: ~ 

當我運行FOQ:彈性彎曲:填充我仍然可以看到「文件」屬性被存儲在_source。我找不出什麼是缺失的。請幫助

+0

什麼是你的類型的名稱?當你從elasticsearch獲取映射時,你會看到什麼?與你提交的一樣,還是隻有一部分? – javanna 2013-04-29 18:21:33

+0

感謝您的回覆。它是symfony2中foqelasticabundle的配置。如果「文檔」是類型的名稱。它是一種附件類型。當我查詢「文檔」時,_source中的結果仍包含「文件」屬性。 – 2013-04-30 04:50:58

回答

0

如果任何人遇到這樣的問題,如果排除您的屬性如下它應該只是工作:

   _source: 
        excludes: 
         [ file ]