gpt4 book ai didi

elasticsearch - Elasticsearch N元语法未返回预期结果

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

试图弄清楚这个小例子的得分。我希望得到brenda eaton的文档,但我得到brenda fassie作为最佳结果。

PUT ngram
{
"settings": {
"analysis": {
"analyzer": {
"my_analyzer": {
"tokenizer": "my_tokenizer"
}
},
"tokenizer": {
"my_tokenizer": {
"type": "ngram",
"min_gram": 3,
"max_gram": 3,
"token_chars": [
"letter",
"digit"
]
}
}
}
},
"mappings": {
"tweet" : {
"properties" : {
"text" : {
"type" : "text",
"analyzer": "my_analyzer"
}
}
}
}
}

PUT ngram/tweet/1
{
"text":"searched the blue sky during the summer"
}
PUT ngram/tweet/2
{
"text":"sdssded the trans hex during the sssss"
}

PUT ngram/tweet/3
{
"text":"searched the brenda eaton during the summer"
}
PUT ngram/tweet/4
{
"text":"sdssded the brenda fassie during the sssss"
}


GET ngram/_search
{
"query": {
"match" : {
"text" : {
"query" : "brenda eaton",
"max_expansions" : 10
}
}
}
}

最佳答案

在填充索引的初始阶段,文档的相关性可能在很大程度上取决于它们在分片中的分布。尝试使用一个主碎片和一个副本碎片创建索引,您将获得所需的结果。

您可以从Elasticsearch指南的以下文章中找到关于此现象的良好解释:Relevance is broken!

关于elasticsearch - Elasticsearch N元语法未返回预期结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51416882/

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