【发布时间】:2015-03-26 15:33:48
【问题描述】:
我不知道 fos elastica 是怎么回事:
当我尝试索引我的实体时,如果显示以下结果:
hey@dotme:/var/www/v2-preprod/httpdocs/current# php app/console fos:elastica:populate
0/438 [>---------------------------] 0%
%message%
第一个实体(此处为 438 个结果)已正确编入索引,但它永远不会进入下一个实体,因此我必须手动填充每个实体(并且每次都必须终止进程)
有什么想法吗?
我设置了 jms 序列化程序以便正确使用 fos elastica。
这是我的配置:
弹性搜索
fos_elastica:
clients:
default: { host: localhost, port: 9200, logger: false }
serializer:
callback_class: FOS\ElasticaBundle\Serializer\Callback
serializer: serializer
indexes:
recetas:
client: default
settings:
index:
analysis:
analyzer:
custom_search_analyzer:
type: custom
tokenizer: standard
filter : [standard, lowercase, asciifolding]
custom_index_analyzer:
type: custom
tokenizer: standard
filter : [standard, lowercase, asciifolding]
filter:
custom_filter:
type: "edgeNGram"
side: front
min_gram: 3
max_gram: 20
types:
Recipe:
mappings:
name:
search_analyzer: custom_search_analyzer
index_analyzer: custom_index_analyzer
type: string
slug:
search_analyzer: custom_search_analyzer
index_analyzer: custom_index_analyzer
type: string
country:
type: string
seen:
type: integer
persistence:
driver: orm # orm, mongodb, propel are available
model: recetas\AppBundle\Entity\Recipe\Recipe
provider:
debug_logging: false
listener: ~
finder: ~
serializer:
groups: [elastica]
Ingredient:
mappings:
name:
search_analyzer: custom_search_analyzer
index_analyzer: custom_index_analyzer
type: string
slug:
search_analyzer: custom_search_analyzer
index_analyzer: custom_index_analyzer
type: string
seen:
type: integer
persistence:
driver: orm # orm, mongodb, propel are available
model: recetas\AppBundle\Entity\Recipe\Ingredient
provider:
debug_logging: false
listener: ~
finder: ~
serializer:
groups: [elastica]
Search:
mappings:
value:
search_analyzer: custom_search_analyzer
index_analyzer: custom_index_analyzer
type: string
date:
type: date
format: basic_date_time
搜索类型没有持久性,因为 symfony 中没有实体,它只是用于记录用户搜索。
【问题讨论】:
-
你可能需要分享你的 foselastica 配置
-
@DerickF 我用我的配置更新了
标签: symfony elasticsearch foselasticabundle