Hi,
Unfortunately, there is no such function, it will require a custom implementation. Please check out the example in this topic, but note that it will require modification How to change categories field type in the filtrable zone - #9 by andrii
I hope this is helpful to you.