gpt4 book ai didi

elasticsearch - 在所有文本都匹配且不重复单词的情况下提高查询分数

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

我正在使用以下查询,但是对于重复的单词,它的得分更高,它是所键入单词的子集,而不是整个句子匹配的单词。

例如:

{
"query": {
"bool": {
"must": {
"multi_match": {
"query": "test in maths",
"fuzziness": "3",
"fields": [
"title"
],
"minimum_should_match": "75%",
"type": "most_fields"
}
}
}
}
}

如果字段值包含: test test test

得分高于字段值: 数学测试

我如何才能使 的确切单词匹配oj​​it_rstrong和而不是重复的单词得分更高?

提前致谢。

最佳答案

如果要搜索准确的句子/短语,则应使用match_phrase查询(https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query-phrase.html)。

您可以添加一个包含匹配短语查询的应句,以将准确短语的分数提高到当前查询中。

关于elasticsearch - 在所有文本都匹配且不重复单词的情况下提高查询分数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58073625/

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