Use regex query in must

I am new to ES, i am having query as

GET 2020-06-03/_search
{
    "query": {
        "bool": {
            "must": [
                {
                    "term": {
                        "Email": "u125@tester.com"
                    }
                },
                {
                    "terms": {
                        "User": [
                            "prot@test.com"
                        ]
                    }
                },
                {
                    "range": {
                        "TimeSp": {
                            "gte": 1588575600,
                            "lte": 1591167599
                        }
                    }
                }
            ]
        }
    },
    "size": 10000,
    "sort": {
        "TimestampSecs": {
            "order": "desc"
        }
    },
    "_source": [
        "Type",
        "Reason",
        "User",
      ]
}

ho can i add regex to terms User?

must is an array of required clauses so just add a regexp query clause in that list

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.