我想在两个查询中 求和* 而不是在以下查询中使用 dis_max 。如何修改此查询来实现? *more_like_this
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
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 } }] } }