我在我的 Symfony 2 项目中使用 FOSElasticaBundle。由于今天重新索引导致以下错误:
index: /app/hotel/1 导致 MapperParsingException[failed to parse [priceFrom]]; 嵌套:NumberFormatException[对于输入字符串:“410.00”];
在我的学说 orm yml 中,该priceFrom
字段定义如下:
priceFrom:
type: decimal
nullable: true
precision: 7
scale: 2
comment: ''
column: price_from
我的fos_elastica
配置看起来像这样(config.yml):
fos_elastica:
clients:
default: { host: localhost, port: 9200 }
indexes:
app:
types:
hotel:
mappings:
id: ~
active: ~
priceFrom: { type: integer }
persistence:
driver: orm
model: XXX\XXXBundle\Entity\Hotel
provider: ~
listener:
immediate: ~
finder: ~
我用来重新索引的命令:php app/console fos:elastica:populate
到目前为止,上述设置一直有效。我希望有人能指出我解决这个问题的好方向。
版本:ruflin/elastica (2.1.0) friendsofsymfony/elastica-bundle (v3.1.5) symfony/symfony (v2.6.11)
PS:我的项目中没有其他实体使用 priceFrom 字段。