make query method used for select filters more flexible

As per my discussion with @t-anjan in #1093