[filter] Improve raw query wrapper.