Symfony 使用FoqElasticBundle排除_源映射中的字段
我有用于Elasticsearch的附件插件,可以为存储在文档中的所有文件编制索引。我想将文件内容从_源文件中排除 我的配置文件看起来像:Symfony 使用FoqElasticBundle排除_源映射中的字段,symfony,
elasticsearch,elastica,Symfony,
elasticsearch,Elastica,我有用于Elasticsearch的附件插件,可以为存储在文档中的所有文件编制索引。我想将文件内容从_源文件中排除 我的配置文件看起来像: document: mappings: id: { index: not_analyzed } path: {} name: { boost: 5}
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:elastica:populate时,我仍然看到“file”属性存储在_source中。我想不出少了什么。请帮助如果其他任何人遇到此问题,如果您按以下方式排除您的属性,它应该可以正常工作:
_source:
excludes:
[ file ]
你的类型叫什么?从elasticsearch中获取映射时,您看到了什么?与您提交的内容相同或只是其中的一部分?感谢您的回复。它是symfony2中foqelasticabundle的配置。如果为“文档”,则为类型的名称。它是一种附件类型。当我查询“document”时,\ u source中的结果仍然包含“file”属性。