rewrite query and filter facet items