How can I filter from other index?

Hello, I am new to kibana and have a question.

I want to filter specific IDs when I aggregate cardinality.

For example, there are [1,2,3](this is ID list) in Index A and [1,2,4,4,5,6,7,7] in Index B, I want the cardinality result in index B {value:4}. The result excludes 1 and 2 which are in Index A.

Is there any ways to do like this?

In SQL, code is like this

select ID
from B
where ID is not in (
select ID
from A)

Hi, unfortunately no, is not possible