Elasticsearch how to use multi_match with wildcard

后端 未结 5 835
再見小時候
再見小時候 2020-12-13 03:55

I have a User object with properties Name and Surname. I want to search these fields using one query, and I found multi_match in the documentation, but I don\'t

5条回答
  •  醉梦人生
    2020-12-13 04:30

    I just did this now:

    GET _search {
        "query": {
            "bool": {
                "must": [
                    {
                        "range": {
                            "theDate": {
                                "gte": "2014-01-01",
                                "lte": "2014-12-31"
                            }
                        }
                    },
                    {
                        "match" : {
                            "Country": "USA"
                        }
                    }
                ],
                "should": [
                    {
                        "wildcard" : { "Id_A" : "0*" }
                    },
                    {
                        "wildcard" : { "Id_B" : "0*" }
                    }
                ],"minimum_number_should_match": 1
            }
        }
    }
    

提交回复
热议问题