gpt4 book ai didi

elasticsearch - ES query_string值的不同提升

转载 作者:行者123 更新时间:2023-12-03 00:52:47 26 4
gpt4 key购买 nike

以普通的ES查询为例:
(在query.bool.should ...中)

{
"term": {
"processedText": {
"boost": 1.9599999999999997,
"value": "some_value"
}
}
},
{
"term": {
"processedText": {
"boost": 3.4489795918367347,
"value": "other_value"

如您所见,我查询的是来自不同值的不同升压值。
如何使用query_string做同样的事情?
 "query_string": {
"query": "(something AND test) OR (foo OR bar OR nothing) NOT (abc OR xyz)",
"default_field": "text"
}

最佳答案

参见"Boosting" paragraph at the Query-String-Query doc:

Use the boost operator ^ to make one term more relevant than another. ... Boosts can also be applied to phrases or to groups.



例:
"query_string": {
"query": "(something AND test)^5 OR (foo^2 OR bar^1.5 OR nothing) NOT (abc OR xyz)",
"default_field": "text"
}

关于elasticsearch - ES query_string值的不同提升,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50369279/

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