gpt4 book ai didi

elasticsearch - ElasticSearch如何使用Boost

转载 作者:行者123 更新时间:2023-12-03 02:08:57 36 4
gpt4 key购买 nike

该查询效果很好,但返回的结果太多。我想添加boost函数,但是我不知道正确的语法。

$data_string = '{
"from" : 0, "size" : 100,
"sort" : [
{ "date" : {"order" : "desc"} }
],
"query": {
"more_like_this_field" : {
"thread.title" : {
"like_text" : "this is a test",
"min_word_len" : 4,
"min_term_freq" : 1,
"min_doc_freq" : 1
}
}
}
}';

最佳答案

找到了解决方案。看起来像使用Fuzzy_like_this_field和min_similarity是要走的路。

$data_string = '{
"from" : 0, "size" : 100,
"query": {
"fuzzy_like_this_field" : {
"thread.title" : {
"like_text" : "this is a test",
"min_similarity": 0.9
}
}
}
}';

关于elasticsearch - ElasticSearch如何使用Boost,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19548169/

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