如何为两个more_like_this查询包含sum子句?
我想在两个查询中 。如何修改此查询来实现? *more_like_this
POST /ucberkley/docs/_search{
"fields": [
"Category"
],
"size": 1500,
"query": {
"dis_max": {
"queries": [{
"more_like_this": {
"fields": [
"PRIMARY_CONTENT_EN"
],
"ids": [
173161
],
"min_term_freq": 1,
"max_query_terms": 2,
"boost": 2
}
}, {
"more_like_this": {
"fields": [
"PRIMARY_CONTENT_EN"
],
"ids": [
175277
],
"min_term_freq": 1,
"max_query_terms": 2,
"boost": -1
}
}]
}
}
}
回答:
实现此目的的一种方法是通过使用子句的布尔查询should
例:
"query": { "bool": {
"disable_coord" : "true",
"should": [{
"more_like_this": {
"fields": [
"PRIMARY_CONTENT_EN"
],
"ids": [
173161
],
"min_term_freq": 1,
"max_query_terms": 2,
"boost": 1
}
}, {
"more_like_this": {
"fields": [
"PRIMARY_CONTENT_EN"
],
"ids": [
175277
],
"min_term_freq": 1,
"max_query_terms": 2,
"boost": -1
}
}]
}
}
以上是 如何为两个more_like_this查询包含sum子句? 的全部内容, 来源链接: utcz.com/qa/408602.html