dromara / easy-es

A foolproof Elasticsearch ORM framework that is easy to use, requires minimal coding, and is highly expandable...

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

能不能自定义设置minimumShouldMatch?

ddmcc opened this issue · comments

我的查询语句中有must和should,并且should中有三个子句,现在不符合should任何一个子句的数据也返回了,有办法设置minimumShouldMatch吗?

或者这种情况有没有替代查法

DSL语句类似:

    "bool": {
        "must": [
            {
                "bool": {
                    "should": [
                        {
                            "range": {
                                "字段xx": {
                                   
                                }
                            }
                        }
                    ]
                }
            }
        ],
        "should": [
            {
                "match": {
                    "字段1": {
                        "query": "xxx",
                        "operator": "OR"
                    }
                }
            },
            {
                "match": {
                    "字段2": {
                        "query": "xxx",
                        "operator": "OR"
                    }
                }
            },
            {
                "match": {
                    "字段3": {
                        "query": "xxx",
                        "operator": "OR"
                    }
                }
            }
        ],
        "adjust_pure_negative": true,
        "boost": 1
    }
}```