Symfony FOSElasticaBundle索引隐藏对象
我已经安装了FOSElasticaBundle,我的配置如下:Symfony FOSElasticaBundle索引隐藏对象,symfony,elasticsearch,foselasticabundle,Symfony,elasticsearch,Foselasticabundle,我已经安装了FOSElasticaBundle,我的配置如下: fos_elastica: clients: default: { host: localhost, port: 9200 } indexes: test: client: default index_name : %elastica_index_name% types: exhibition:
fos_elastica:
clients:
default: { host: localhost, port: 9200 }
indexes:
test:
client: default
index_name : %elastica_index_name%
types:
exhibition:
mappings:
name : { boost: 100 }
company: { boost: 9 }
directions: { boost: 8}
tags: { boost: 7 }
description : { boost: 6 }
status : ~
persistence:
driver: orm
model: Test\MainBundle\Entity\Exhibition
finder: ~
provider: ~
listener:
is_indexable_callback: "isPublic"
在persist上是可索引的\u回调
有效。但当我运行fos:elastica:populate
时,索引甚至会为隐藏对象创建
如何为活动对象编制索引?也许是用分析仪之类的
提前谢谢 您应该指定:
provider:
query_builder_method: createSearchIndexQueryBuilder
然后将方法添加到相关的Entity\Repository
:
public function createSearchIndexQueryBuilder()
{
$qb = $this->createQueryBuilder()
//->write_magic_here;
return $qb;
}