NXP-14013: Factorize code that convert expression to ES query