gpt4 book ai didi

symfony - "mappings"下无法识别的选项 "fos_elastica.indexes.app.types.user"

转载 作者:行者123 更新时间:2023-12-03 01:33:38 24 4
gpt4 key购买 nike

我将 symfony 与 fos elastica bundle 一起使用。我正在尝试添加本教程中的映射 https://www.codevate.com/blog/14-implementing-search-as-you-type-autocomplete-with-elasticsearch-and-symfony但是,得到了这个错误:
Unrecognized option "mappings" under "fos_elastica.indexes.app.types.user"
这是我的配置:

# Read the documentation: https://github.com/FriendsOfSymfony/FOSElasticaBundle/blob/master/Resources/doc/setup.md
fos_elastica:
clients:
default: { host: localhost, port: 9200 }
# indexes:
# app: ~
indexes:
app:
client: default
settings:
index:
analysis:
analyzer:
name_analyzer:
type: custom
tokenizer: standard
filter: [standard, lowercase, asciifolding, elision]
types:
user:
properties:
username: ~
# mappings:
# email: ~
mappings:
username:
type: completion
analyzer: name_analyzer
search_analyzer: name_analyzer
payloads: true
persistence:
# the driver can be orm, mongodb, phpcr or propel
# listener and finder are not supported by
# propel and should be removed
driver: orm
model: App\Entity\User
provider: ~
listener: ~
finder: ~

最佳答案

fos_elastica 配置中没有“映射”属性。您可以使用以下命令列出所有可能的配置属性:

php bin/console config:dump-reference fos_elastica

尝试改变 mappingsproperties并删除空 properties在上面的配置中键入。

如果遇到类似错误,请尝试使用配置引用或官方文档:

https://github.com/FriendsOfSymfony/FOSElasticaBundle/blob/v5.0.3/doc/types.md

关于symfony - "mappings"下无法识别的选项 "fos_elastica.indexes.app.types.user",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54179246/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com