Document level security must match with and condition

Hi All,

I have created a kibana role with below DLS condition

{
“bool”: {
“must”: {
“match”: {
“proxyvalue”: “TestApi”
}
}
}
}

i need to add one more DLS bool must match condition for the same kibana role , like below
{
“bool”: {
“must”: {
“match”: {
“proxyvalue”: “TestApi” && “proxyvalue”: “NonTestApi”
}
}
}
}

is that possible to do
is there any other way to add two match conditions

help on this issue highly appreciated…!

Do it like below.

{
  "terms": {
    "proxyvalue": [
      "TestApi",
      "NonTestApi"
    ]
  }
}

I had some cases where the below configs worked for me:

This is equivalent to boolean OR:

{
  "bool" : {
    "should": [{
        "match": {
            "proxyvalue": "TestApi"
        }
    }, {
        "match": {
            "proxyvalue": "NonTestApi"
        }
    }]
  }
}

And this is equivalent to boolean AND:

{
"bool" : {
  "must": [{
      "match": {
          "proxyvalue": "TestApi"
      }
  }, {
      "match": {
          "proxyvalue": "NonTestApi"
      }
  }]
}

}
}