Use UnionFilter for handling type: and type-ref: queries.