我已经安装了FOSElasticaBundle,配置fos_elastica.yml如下所示:
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"在持久化is_indexable_callback上工作。但是当我运行fos:elastica:populate时,即使是为隐藏对象创建索引。
如何才能索引活动对象?也许用分析器之类的?
提前感谢!
发布于 2014-04-03 16:27:53
你应该具体说明:
provider:
query_builder_method: createSearchIndexQueryBuilder然后将方法添加到相关的Entity\Repository中。
public function createSearchIndexQueryBuilder()
{
$qb = $this->createQueryBuilder()
//->write_magic_here;
return $qb;
}https://stackoverflow.com/questions/22835258
复制相似问题