gpt4 book ai didi

elasticsearch - 弹性查询仅接受4个字符

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

我在 flex 搜索7.2版中运行术语查询,当我的查询中有4个字符时,它可以工作,并且如果我添加或删除任何字符,都无法正常工作。
工作查询:

{
"query": {
"bool": {
"must": [{
"terms": {
"GEP_PN": ["6207"]
}
},
{
"match": {
"GEP_MN.keyword": "SKF"
}
}
]
}
}
}
结果: enter image description here
查询失败:
enter image description here

最佳答案

它没有失败,没有找到您的搜索词的结果,请注意docs中提到的terms query are not analyzed

Returns documents that contain one or more exact terms in a providedfield.


请提供索引的映射,如果它使用 text字段并且未使用custom-analyzer,它将使用 standard analyzer来拆分 -上的标记,因此您的字词查询与倒排索引中存在的标记不匹配。
请参阅analyze API o / p作为您的搜索词,它解释了可能的根本原因。
{
"text" : "6207-R"
}
token
{
"tokens": [
{
"token": "6207",
"start_offset": 0,
"end_offset": 4,
"type": "<NUM>",
"position": 0
},
{
"token": "r",
"start_offset": 5,
"end_offset": 6,
"type": "<ALPHANUM>",
"position": 1
}
]
}

关于elasticsearch - 弹性查询仅接受4个字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63388782/

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