Fix display filters

Previous PRs introduced a bug with advanced search display filters when using both "Tree" and "Resource" filters, which required a rewrite.