I am using Magento 2 with elastic search enabled. I have a custom filtering of the product collection.

Now, when elastic search is enabled, custom filtering don't work however with MySQL search, it does work.

Any idea what's causing the issue or how elastic search is creating the product collection query?