gpt4 book ai didi

symfony - Asciifolding无法与FOSElasticabundle一起使用

转载 作者:行者123 更新时间:2023-12-02 22:23:07 28 4
gpt4 key购买 nike

我正在使用序列化器来获取字段,并使用了pelpel插件来进行波兰语搜索elasticSearch。试图获得类似于此示例的内容,但未成功:

https://www.elastic.co/guide/en/elasticsearch/guide/current/asciifolding-token-filter.html#asciifolding-token-filter

这是我的配置:

fos_elastica:
serializer: ~
clients:
default: { host: 127.0.0.1, port: 9200 }
indexes:
bpo:
settings:
index:
analysis:
analyzer:
folding:
tokenizer: standard
filter: [standard, lowercase, asciifolding, polish_stem]
types:
company:
properties:
name:
type: string
analyzer: standard
fields:
folded:
type: string
analyzer: folding
serializer:
groups: [elastica]
version: '1.1'
serialize_null: true
persistence:
driver: orm
model: AppBundle\Entity\Company
repository: AppBundle\Repository\CompanyRepository
provider: ~
finder: ~

然后检查:
$ curl "127.0.0.1:9200/bpo/_analyze?analyzer=folding&text=spółka&pretty"
{
"tokens" : [ {
"token" : "spᅢ뺴",
"start_offset" : 0,
"end_offset" : 5,
"type" : "<ALPHANUM>",
"position" : 0
}, {
"token" : "ツ",
"start_offset" : 5,
"end_offset" : 6,
"type" : "<KATAKANA>",
"position" : 1
}, {
"token" : "ka",
"start_offset" : 6,
"end_offset" : 8,
"type" : "<ALPHANUM>",
"position" : 2
} ]
}

即使试图获取 ß ⇒ ss
$ curl "127.0.0.1:9200/bpo/_analyze?analyzer=folding&text=ß&pretty"
{
"tokens" : [ {
"token" : "ᅢ゚",
"start_offset" : 0,
"end_offset" : 2,
"type" : "<HANGUL>",
"position" : 0
} ]
}

当我尝试从浏览器获取一些响应时,“spółka”为我提供了正确的数据,但“spolka”却未返回任何内容。

我需要过滤器,还是什么?

最佳答案

我解决了这个问题,将购买分析器的名称从“折叠”更改为“默认”。
这项工作对我来说。

工作配置:

fos_elastica:
serializer: ~
clients:
default: { host: 127.0.0.1, port: 9200 }
indexes:
bpo:
settings:
index:
analysis:
analyzer:
default:
tokenizer: standard
filter: [standard, lowercase, asciifolding, polish_stem]

关于symfony - Asciifolding无法与FOSElasticabundle一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44178339/

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